Skip to content

Conversation

hawkfish
Copy link
Contributor

Rewrite the pattern LIST(x ORDER BY x <ordering>) as LIST_SORT(LIST(x), <ordering>). This reduces the included benchmark run time from 23.5s to 4.32s.

Richard Wesley added 3 commits March 14, 2023 14:44
Move the linked list code out for reuse.
Rewrite the pattern LIST(x ORDER BY x <ordering>) as LIST_SORT(LIST(x), <ordering>).
This reduces the included benchmark run time from 23.5s to 4.32s.
@hawkfish hawkfish requested a review from taniabogatsch March 15, 2023 20:59
Copy link
Collaborator

@Mytherin Mytherin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Looks great. Can we also add some tests for this behavior? For example, some optimizer tests that look at the plan to verify the optimization is performed - but also tests with different ORDER BY constructs to verify the result is still correct after optimization (e.g. different mixes of ORDER BY x, ORDER BY x DESC, ORDER BY x DESC NULLS LAST, etc)?

@Mytherin Mytherin merged commit b62a760 into duckdb:master Mar 24, 2023
@Mytherin
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants