-
Notifications
You must be signed in to change notification settings - Fork 894
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
Vectorized aggregation with grouping by one fixed-size column #7341
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7341 +/- ##
==========================================
+ Coverage 80.06% 82.27% +2.21%
==========================================
Files 190 237 +47
Lines 37181 43668 +6487
Branches 9450 10957 +1507
==========================================
+ Hits 29770 35930 +6160
- Misses 2997 3403 +406
+ Partials 4414 4335 -79 ☔ View full report in Codecov by Sentry. |
tsl/src/nodes/vector_agg/exec.c
Outdated
} | ||
} | ||
|
||
/* | ||
* Currently the only grouping policy we use is per-batch grouping. | ||
* Determine which grouping policy we are going to use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity: Why is the grouping policy decided at execution time and not plan time? Should it not affect the plan and cost calc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it all to plan time, although as we discussed today on call, it doesn't affect the costs yet.
Co-authored-by: Erik Nordström <[email protected]> Signed-off-by: Alexander Kuzmenkov <[email protected]>
Co-authored-by: Erik Nordström <[email protected]> Signed-off-by: Alexander Kuzmenkov <[email protected]>
The implementation uses the Postgres simplehash hash table for by-value fixed-size compressed columns.
The biggest improvement on a "sensible" query is about 90%, and a couple of queries show bigger improvements but these are very synthetic cases that don't make much sense:
https://grafana.ops.savannah-dev.timescale.com/d/fasYic_4z/compare-akuzm?orgId=1&var-branch=All&var-run1=3815&var-run2=3816&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