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
Speedup MIN and MAX for native types #58231
Conversation
This is an automated comment for commit 68787ce with description of existing statuses. It's updated for the latest CI running ✅ Click here to open a full report in a separate page Successful checks
|
I've been doing some local tests and it does show some improvement, but way less than expected. The problem with my assumption is that the if aggregate function execution was 20% of the query you can't speed it up over 20% 😄 An extract from perf:
Now it's spending pretty much the same amount of time calculating the min as in |
Some perf tests: Setup:
MIN
Some thoughts:
|
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Continuation from #40633 but instead of implementing new classes, which was deemed too dangerous because it duplicated storage code, it implements the new performance improvements by declaring subclasses that implement
addBatchSinglePlace
andaddBatchSinglePlaceNotNull
for min and max.Note that I've only enabled SSE and AVX2 because I didn't see any improvement for AVX512 instructions, so less code to compile.
What's missing from the original PR but I intent to push in different PRs:
ANY
to remove theAggregateFunctionsSingleValue::is_any
hack.findNumericExtremeIndex
)