-
Notifications
You must be signed in to change notification settings - Fork 1.8k
reimplement eliminate_outer_join
#4272
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
| } | ||
| } | ||
|
|
||
| /// Attempt to eliminate outer joins to inner joins. |
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.
Question from a beginner:
Can a JOIN be always optimized to the INNER JOIN?
For example:
for a query
select ... from a full join b where a.xx = 100
we could only optimize it to a RIGHT JOIN.
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.
You can see fn eliminate_outer()
Your example, this rule can do.
We can eliminate Full -> ROJ/LOJ/Inner
9aab04d to
5b7f33b
Compare
5b7f33b to
40d62e8
Compare
| _optimizer_config, | ||
| )?), | ||
| )?)) | ||
| pub fn eliminate_outer( |
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.
Thank you for eliminating the duplication
|
Benchmark runs are scheduled for baseline = e817d75 and contender = 502b7e3. 502b7e3 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
|
Filed a follow on PR to add some docstrings: #4343 |
|
Sorry for the delay in reviewing @jackwener -- the PRs are flowing fast an furious this week |
Which issue does this PR close?
Closes #4270
Part of #4267
reimplement
eliminate_outer_jointo avoid to useglobal-state.In new implementation, we just depends only on the shape of the subtree.
Rationale for this change
We don't have to worry about the filter not being above the Join.
Because this rule will cooperate with
filter_push_down. If a predicate which can eliminate outer exist, it will be pushdown and stop above an outer-join.What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?