Skip to content

fix(sql): fix group by performance when selected columns have aliases#3013

Merged
bluestreak01 merged 4 commits intomasterfrom
fix_group_by_with_alias_perf
Feb 23, 2023
Merged

fix(sql): fix group by performance when selected columns have aliases#3013
bluestreak01 merged 4 commits intomasterfrom
fix_group_by_with_alias_perf

Conversation

@puzpuzpuz
Copy link
Contributor

@puzpuzpuz puzpuzpuz commented Feb 22, 2023

Fixes #2566

Changes SelectedRecordCursorFactory to support page frame when the underlying base factory supports them. This enables vectorization for queries with transitioning query model such as select s as symbol, count() from x. In such queries SelectedRecordCursorFactory is used as an intermediate factory between the upper-level group by factory and lower-level DataFrameRecordCursorFactory.

@puzpuzpuz puzpuzpuz added Bug Incorrect or unexpected behavior SQL Issues or changes relating to SQL execution Performance Performance improvements labels Feb 22, 2023
@puzpuzpuz puzpuzpuz self-assigned this Feb 22, 2023
@puzpuzpuz puzpuzpuz requested a review from jerrinot February 22, 2023 17:17
@jerrinot
Copy link
Contributor

@puzpuzpuz I haven't started the review yet, but I already have one ask: Please add the idea behind the fix as a PR description. Just a sentence or two explaining why it was slower before and what about this PR makes it faster. Thanks a lot!

@puzpuzpuz
Copy link
Contributor Author

@puzpuzpuz I haven't started the review yet, but I already have one ask: Please add the idea behind the fix as a PR description. Just a sentence or two explaining why it was slower before and what about this PR makes it faster. Thanks a lot!

Good point. Did my best to describe the changes. See the PR description.

@ideoma
Copy link
Collaborator

ideoma commented Feb 23, 2023

[PR Coverage check]

😍 pass : 31 / 40 (77.50%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/engine/table/SelectedRecordCursorFactory.java 28 37 75.68%
🔵 io/questdb/griffin/SqlOptimiser.java 3 3 100.00%

@bluestreak01 bluestreak01 merged commit 4da7b10 into master Feb 23, 2023
@bluestreak01 bluestreak01 deleted the fix_group_by_with_alias_perf branch February 23, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Incorrect or unexpected behavior Performance Performance improvements SQL Issues or changes relating to SQL execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance degradation when aliasing columns

4 participants