timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
16.82k stars 852 forks source link

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

Open akuzm opened 3 weeks ago

akuzm commented 3 weeks ago

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.

This doesn't induce notable behavior changes as of now, but is needed for PR https://github.com/timescale/timescaledb/pull/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

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.64%. Comparing base (59f50f2) to head (5fe7c52). Report is 216 commits behind head on main.

:exclamation: Current head 5fe7c52 differs from pull request most recent head 9a0a988

Please upload reports for the commit 9a0a988 to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #7025 +/- ## ========================================== + Coverage 80.06% 81.64% +1.57% ========================================== Files 190 199 +9 Lines 37181 37000 -181 Branches 9450 9673 +223 ========================================== + Hits 29770 30208 +438 + Misses 2997 2894 -103 + Partials 4414 3898 -516 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.