Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply sort transform optimizations to compressed chunks #7528

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

akuzm
Copy link
Member

@akuzm akuzm commented Dec 11, 2024

Currently we transform sorting by time_bucket to sorting by time only for uncompressed chunks. Implement it for the compressed chunks as well.

In tsbench, some queries are up to 770x faster:
https://grafana.ops.savannah-dev.timescale.com/d/fasYic_4z/compare-akuzm?orgId=1&var-branch=All&var-run1=3997&var-run2=3998&var-threshold=0.02&var-use_historical_thresholds=true&var-threshold_expression=2%20%2A%20percentile_cont%280.90%29&var-exact_suite_version=false&from=now-2d&to=now

Should improve the query plans in this issue: #6310

Currently we transform sorting by `time_bucket` to sorting by
`time` only for uncompressed chunks. Implement it for the compressed
chunks as well.
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 88.33333% with 7 lines in your changes missing coverage. Please review.

Project coverage is 82.21%. Comparing base (59f50f2) to head (15dfa17).
Report is 664 commits behind head on main.

Files with missing lines Patch % Lines
tsl/src/nodes/decompress_chunk/planner.c 72.22% 2 Missing and 3 partials ⚠️
src/sort_transform.c 93.54% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7528      +/-   ##
==========================================
+ Coverage   80.06%   82.21%   +2.14%     
==========================================
  Files         190      231      +41     
  Lines       37181    43413    +6232     
  Branches     9450    10923    +1473     
==========================================
+ Hits        29770    35693    +5923     
- Misses       2997     3393     +396     
+ Partials     4414     4327      -87     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@akuzm akuzm marked this pull request as ready for review December 17, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant