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

perf(sql): speed up GROUP BY queries with ORDER BY and LIMIT #4523

Merged
merged 3 commits into from
May 18, 2024

Conversation

puzpuzpuz
Copy link
Contributor

@puzpuzpuz puzpuzpuz commented May 17, 2024

For cursors used in GROUP BY, recordAt call is relatively expensive, so not calling it on each row in the LIMIT N case is beneficial.

@puzpuzpuz puzpuzpuz added SQL Issues or changes relating to SQL execution Performance Performance improvements labels May 17, 2024
@puzpuzpuz puzpuzpuz self-assigned this May 17, 2024
@puzpuzpuz puzpuzpuz changed the title perf(sql): avoid frequent recordAt calls in case of ORDER BY and LIMIT perf(sql): speed up GROUP BY queries with ORDER BY and LIMIT May 17, 2024
@ideoma
Copy link
Collaborator

ideoma commented May 17, 2024

[PR Coverage check]

😍 pass : 7 / 7 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/engine/orderby/LimitedSizeLongTreeChain.java 7 7 100.00%

@bluestreak01 bluestreak01 merged commit b483625 into master May 18, 2024
24 checks passed
@bluestreak01 bluestreak01 deleted the puzpuzpuz_speed_up_sort branch May 18, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Performance improvements SQL Issues or changes relating to SQL execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants