-
Notifications
You must be signed in to change notification settings - Fork 597
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
perf(over window): shortcut implementation for first_value
and last_value
in over window
#19233
Conversation
Signed-off-by: Richard Chien <[email protected]>
This stack of pull requests is managed by Graphite. Learn more about stacking. |
first_value
and last_value
in over window
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.
Really so 🐮?
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.
Really so 🐮?
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.
Really so 🐮?
…t_value` in over window (#19233) Signed-off-by: Richard Chien <[email protected]>
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Previously we reuse batch aggregator for
first_value
andlast_value
in OverWindow, and this required an O(n) iteration through the "current window" when evaluating output for each row. This PR introduces shortcut implementations fro these two special aggregate types to avoid the need of O(n) iteration.This also benefits
lag
andlead
because they are implemented withfirst_value
andlast_value
under the hood.A rough benchmark with a dumb query based on nexmark source showed a 392% source throughput increase introduced by this PR, during the first 10 minutes after streaming job creation.
Query:
Before:
After:
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.