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

Improve performance when planning multiple window functions #18504

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

martint
Copy link
Member

@martint martint commented Aug 2, 2023

Instead of planning each window function in a separate WindowNode, group them together as long as they have the same window specification.

This helps reduce deep plan trees and simplify the structure of the plan by removing redundant operations (e.g., projections to compute frame bounds, filters to ensure frame bounds are legal, etc.), that make it harder for optimizer rules to match and remove later.

Mitigates #18491

Release notes

(x) Release notes are required, with the following suggested text:

# General
* Improve performance when planning queries involving multiple window functions. ({issue}`18491`)

martint added 2 commits August 2, 2023 09:39
It was printing the value from the original query instead of
the actual input in the plan. This made it harder to see whether
and where some columns were being used.
Instead of planning each window function in a separate WindowNode,
group them together as long as they have the same window specification.

This helps reduce deep plan trees and simplify the structure of the plan
by removing redundant operations (e.g., projections to compute frame bounds,
filters to ensure frame bounds are legal, etc.), that make it harder for
optimizer rules to match and remove later.
@cla-bot cla-bot bot added the cla-signed label Aug 2, 2023
@martint martint changed the title Window planning time Improve performance when planning multiple window functions Aug 2, 2023
@martint martint requested review from kasiafi and sopel39 August 2, 2023 17:45
@martint martint merged commit 3661df8 into trinodb:master Aug 3, 2023
@martint martint deleted the window-planning-time branch August 3, 2023 03:35
@github-actions github-actions bot added this to the 423 milestone Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants