8000 Allow `row_number` `rank` without `PARTITION BY` when using Top-N pattern · Issue #21991 · risingwavelabs/risingwave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow row_number rank without PARTITION BY when using Top-N pattern #21991

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

Open
stdrc opened this issue May 26, 2025 · 1 comment
Open

Allow row_number rank without PARTITION BY when using Top-N pattern #21991

stdrc opened this issue May 26, 2025 · 1 comment
Labels
A-topn Area: TopN type/perf Type: Performance.

Comments

@stdrc
Copy link
Member
stdrc commented May 26, 2025

For top-N queies with something like RANK() OVER (PARTITION BY CAST(1 AS INT) ORDER BY some_column) AS rank, the plan won't be optimal because we don't do 2-phase optimization for GroupTopN, but the function call actually is global TopN (group by a constant). Since the number of input for OverWindow is limited after GroupTopN, we can allow eliminate PARTITION BY in such queries.

@stdrc stdrc added type/perf Type: Performance. A-topn Area: TopN labels May 26, 2025
@stdrc
Copy link
Member Author
stdrc commented May 26, 2025

As a background, we currently don't support general window function calls without PARTITION BY because we believe the performance won't be good and the user should rethink about their query. #11505

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-topn Area: TopN type/perf Type: Performance.
Projects
None yet
Development

No branches or pull requests

1 participant
0