-
Notifications
You must be signed in to change notification settings - Fork 6.1k
planner: simplify outer join other conditions #66015
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Please upload reports for the commit 75e4a70 to get more accurate results. Additional details and impacted files@@ Coverage Diff @@
## master #66015 +/- ##
================================================
- Coverage 77.7600% 77.0458% -0.7142%
================================================
Files 2001 1923 -78
Lines 546165 534566 -11599
================================================
- Hits 424698 411861 -12837
- Misses 119805 122697 +2892
+ Partials 1662 8 -1654
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/check-issue-triage-complete |
|
/retest |
| "select /* double_not_left_join_exec */ t0.k0, t2.k0 from t0 left join t2 on not not (t0.k0 = t2.k0) order by t0.k0, t2.k0", | ||
| "select /* double_not_right_join_exec */ t0.k0, t2.k0 from t0 right join t2 on not not (t0.k0 = t2.k0) order by t2.k0, t0.k0", | ||
| "select /* double_not_semi_join_exec */ t0.k0 from t0 where exists (select 1 from t2 where not not (t0.k0 = t2.k0)) order by t0.k0" | ||
| "select /* double_not_semi_join_exec */ t0.k0 from t0 where exists (select 1 from t2 where not not (t0.k0 = t2.k0)) order by t0.k0", |
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.
What's double_not_semi_join_exec a label for this test case?
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.
It's more like a comment or a prompt.
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.
where not not (t0.k0 = t2.k0))
| // However, we still need to eliminate obvious logical constants in OtherConditions | ||
| // (e.g. "a = b OR 0") to avoid losing join keys. | ||
| p.OtherConditions = ruleutil.ApplyPredicateSimplificationForJoin( | ||
| p.SCtx(), |
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.
Do we need to call this function for other join types, like semi/anti/inner?
Also we can move this function call inside PredicatePushDown, becase there is no much logic, and a new function seems meanless.
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.
other LGTM
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.
Great, I have rafactored this code.
Signed-off-by: Weizhen Wang <[email protected]>
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guo-shaoge The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
Signed-off-by: Weizhen Wang <[email protected]>
|
/retest |
Signed-off-by: Weizhen Wang <[email protected]>
|
@hawkingrei: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #65994
Problem Summary:
a=b OR 0) are not simplified, which prevents join key extraction and can lead to incorrect plans/results after predicate pushdown.What changed and how does it work?
OtherConditionsto eliminate trivial OR constants and keep join keys.Check List
Tests
Side effects
Documentation
Release note