-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Order by tuple #38873
Order by tuple #38873
Conversation
39e48bb
to
c7f9945
Compare
c7f9945
to
8f51f1f
Compare
- remove unnecessary code for this PR
8f51f1f
to
a0f6f6f
Compare
@Mergifyio update |
✅ Branch has been successfully updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
consider maybe unnecessary changes
BTW this optimization makes WITH FILL works for such case 👍 |
I didn't think about it. Thanks for mentioning it. I'd like to add a test before merge it |
@Mergifyio update |
❌ Base branch update has failedmerge conflict between base and head |
- complexity comes from dreaming about EXPLAIN queries as an ordinary ones returning scalar result. So they can be used in SQL tests instead of shell ones
# check that both queries have the same AST after rewrite, EXPLAIN SYNTAX returns it in form of query | ||
################## | ||
QUERY_ORDER_BY="SELECT number AS a, number % 2 AS b FROM numbers(10) ORDER BY a DESC NULLS FIRST WITH FILL FROM 2 TO 1 STEP -1, b DESC NULLS FIRST WITH FILL FROM 2 TO 1 STEP -1" | ||
QUERY_ORDER_BY_TUPLE="SELECT number AS a, number % 2 AS b FROM numbers(10) ORDER BY (a, b) DESC NULLS FIRST WITH FILL FROM 2 TO 1 STEP -1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devcrafter I'm not sure if we can do such an optimization. Is the query without optimization and with this WITH FILL
valid?
Changelog category (leave one):
Fixes #38772
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
A less efficient execution plan can be generated for query with ORDER BY (a, b) than for ORDER BY a, b