-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
planner: fix the issue that the optimizer cannot convert OUTER JOIN to INNER JOIN with nested AND/OR in some cases #49625
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #49625 +/- ##
================================================
+ Coverage 70.9801% 71.4239% +0.4438%
================================================
Files 1368 1423 +55
Lines 398761 417055 +18294
================================================
+ Hits 283041 297877 +14836
- Misses 95945 100360 +4415
+ Partials 19775 18818 -957
Flags with carried forward coverage won't be shown. Click here to find out more.
|
pkg/planner/core/integration_test.go
Outdated
tk.MustExec(`use test`) | ||
tk.MustExec(`create table t1 (k int, a int)`) | ||
tk.MustExec(`create table t2 (k int, b int, key(k))`) | ||
tk.MustHavePlan(`select /*+ tidb_inlj(t2, t1) */ * | ||
from t2 left join t1 on t1.k=t2.k | ||
where a>0 or (a=0 and b>0)`, `IndexJoin`) |
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.
I suggest to move this test into pkg/planner/core/issuetest
.
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.
fixed
Co-authored-by: Zhou Kunqin <25057648+time-and-fate@users.noreply.github.com>
[LGTM Timeline notifier]Timeline:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, time-and-fate, winoros The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick release-6.5 |
@qw4990: new pull request created to branch In response to this:
Instructions 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 ti-community-infra/tichi repository. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@qw4990: new pull request created to branch In response to this:
Instructions 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 ti-community-infra/tichi repository. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@qw4990: new pull request created to branch In response to this:
Instructions 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 ti-community-infra/tichi repository. |
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.
@qw4990 : The general solution to null filtering condition NFC is simple and wondering why we need to limit to this special case.
NFC (A and B) = NFC(A) OR NFC(B)
NFC (A OR B) = NFC(A) AND NFC(B)
We do have NFC logic for primitive conditions and should be easy to do this general fix.
What problem does this PR solve?
Issue Number: close #49616
Problem Summary: planner: fix the issue that the optimizer cannot convert OUTER JOIN to INNER JOIN with nested AND/OR in some cases
What changed and how does it work?
planner: fix the issue that the optimizer cannot convert OUTER JOIN to INNER JOIN with nested AND/OR in some cases
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.