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

Choose cheapest aggregated path as base for chunk-wise aggregation #7025

Merged
merged 68 commits into from
Dec 10, 2024

Conversation

akuzm
Copy link
Member

@akuzm akuzm commented Jun 12, 2024

Currently we use the cheapest path before final aggregation for this (i.e. Append over individual chunks), but it does not consider the cost of a Sort that might be required before aggregation. To account for this, use instead the child path of the cheapest final aggregated path. Remove duplicate handling of parallel paths, because the cheapest path is either parallel or not, and we don't need to handle both together.

This is mostly needed for PR #6879 , where we introduce the unsorted DecompressChunk paths into consideration, and they are wrongly chosen as a basis for partial aggregation without regard for the cost of Sort over Append.

Disable-check: force-changelog-file

akuzm added 3 commits June 12, 2024 13:00
Currently we use the cheapest path before final aggregation for this
(i.e. Append over individual chunks), but it does not consider the cost
of a Sort that might be required before aggregation. To account for
this, use instead the child path of the cheapest final aggregated path.
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

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

Project coverage is 82.16%. Comparing base (59f50f2) to head (3ba8a8c).
Report is 644 commits behind head on main.

Files with missing lines Patch % Lines
tsl/src/chunkwise_agg.c 90.14% 1 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7025      +/-   ##
==========================================
+ Coverage   80.06%   82.16%   +2.09%     
==========================================
  Files         190      230      +40     
  Lines       37181    43219    +6038     
  Branches     9450    10875    +1425     
==========================================
+ Hits        29770    35512    +5742     
- Misses       2997     3385     +388     
+ Partials     4414     4322      -92     

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

akuzm added 10 commits June 17, 2024 12:27
This is important for the common case of grouping by time_bucket(). In
this case, under AggPath there is a ProjectionPath above the Append node
for all the chunks. When we make a chunkwise aggregation plan, we have
to put a similar ProjectionPath under each per-chunk AggPath.
@akuzm akuzm mentioned this pull request Jun 19, 2024
13 tasks
@akuzm akuzm marked this pull request as ready for review December 5, 2024 14:06
Copy link

github-actions bot commented Dec 5, 2024

@fabriziomello, @antekresic: please review this pull request.

Powered by pull-review

@akuzm akuzm enabled auto-merge (squash) December 10, 2024 09:51
@akuzm akuzm merged commit 7b32f8d into timescale:main Dec 10, 2024
47 of 48 checks passed
@akuzm akuzm deleted the cheap-agg branch December 10, 2024 09:51
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.

3 participants