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

Pushdown LIMIT and ORDER BY for realtime caggs #7271

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

svenklemm
Copy link
Member

Previously ordered queries on realtime caggs would always lead to full table scan as the query plan would have a sort with the limit on top. With this patch this gets changed so that the ORDER BY and LIMIT can be pushed down so the query can benefit from the ordered append optimization and does not require full table scan.

Fixes #4861

@svenklemm svenklemm self-assigned this Sep 16, 2024
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 20.45455% with 35 lines in your changes missing coverage. Please review.

Project coverage is 92.17%. Comparing base (59f50f2) to head (41f93bf).
Report is 342 commits behind head on main.

Files with missing lines Patch % Lines
tsl/src/continuous_aggs/planner.c 14.63% 35 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7271       +/-   ##
===========================================
+ Coverage   80.06%   92.17%   +12.10%     
===========================================
  Files         190      205       +15     
  Lines       37181    38366     +1185     
  Branches     9450     9957      +507     
===========================================
+ Hits        29770    35362     +5592     
- Misses       2997     3003        +6     
+ Partials     4414        1     -4413     

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

Previously ordered queries on realtime caggs would always lead to full
table scan as the query plan would have a sort with the limit on top.
With this patch this gets changed so that the ORDER BY and LIMIT can
be pushed down so the query can benefit from the ordered append
optimization and does not require full table scan.

Fixes timescale#4861
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Querying CAGG scan the whole chunk
1 participant