-
Notifications
You must be signed in to change notification settings - Fork 2.8k
BugFix: Introducing Introducing Delim Joins and Delim_Get(s) should respect positionally #11812
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
Conversation
lnkuiper
left a comment
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.
Looks good! Just two minor comments:
| ) | ||
| FROM all_types outer_alltypes GROUP BY ALL; | ||
|
|
||
| mode skip |
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.
Is the skip here intentional?
| // first check if the logical operator has correlated expressions | ||
| auto entry = has_correlated_expressions.find(*plan); | ||
| bool exit_projection = false; | ||
| unique_ptr<LogicalDelimGet> delim_scan = nullptr; |
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.
nitpick: unique_ptr is initialized to nullptr by default
lnkuiper
left a comment
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 now, thanks!
|
Thanks! |
Merge pull request duckdb/duckdb#11812 from Tmonster/delim_joins_and_reordering
fixes https://github.com/duckdblabs/duckdb-internal/issues/1807
In queries where a correlated subquery requires a delim get, we want to preserve positionally of columns. Operators can get moved around and when operators get moved around the positionally of columns can change. This is especially bad when you have set operations, where positionally is important.
A delim_get is introduced with a cross product. The children of a cross product can be flipped around by the join order optimizer, affecting the positionally of the columns. With this fix, if a projecition wants to introduce a delim get, the delim get cross product is produced under it.