-
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: support index_lookup_merge_join in physical plan. #11338
planner: support index_lookup_merge_join in physical plan. #11338
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11338 +/- ##
================================================
- Coverage 81.5939% 81.3384% -0.2555%
================================================
Files 445 445
Lines 96566 95571 -995
================================================
- Hits 78792 77736 -1056
- Misses 12241 12302 +61
Partials 5533 5533 |
e6cf850
to
38a0de2
Compare
e64ebc4
to
05b6b5b
Compare
…erge_join_in_physical_plan
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
Co-Authored-By: Kenan Yao <cauchy1992@gmail.com>
Co-Authored-By: Kenan Yao <cauchy1992@gmail.com>
Co-Authored-By: Kenan Yao <cauchy1992@gmail.com>
└─IndexReader_91 9.99 root index:Selection_90 | ||
└─Selection_90 9.99 cop not(isnull(test.p.relate_id)) | ||
└─IndexScan_89 10.00 cop table:p, index:relate_id, range: decided by [eq(test.p.relate_id, test.tr.id)], keep order:false, stats:pseudo | ||
└─TopN_16 0.00 root test.te.expect_time:asc, offset:0, count:5 |
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 wried, it should be a Limit
operator?
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 the result of rule_topn_push_down
.
1 similar comment
…erge_join_in_physical_plan
@@ -404,6 +406,15 @@ func (p PhysicalIndexJoin) Init(ctx sessionctx.Context, stats *property.StatsInf | |||
return &p | |||
} | |||
|
|||
// Init initializes PhysicalIndexMergeJoin. | |||
func (p PhysicalIndexMergeJoin) Init(ctx sessionctx.Context) *PhysicalIndexMergeJoin { | |||
ctx.GetSessionVars().PlanID++ |
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.
We can call p.PhysicalIndexJoin.Init(ctx)
, then reset p.tp
.
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.
PhysicalIndexJoin.Init(ctx)
new
s a new basePlan
. I think that's unnecessary.
planner/core/physical_plan_test.go
Outdated
@@ -1360,20 +1360,20 @@ func (s *testPlanSuite) TestIndexJoinUnionScan(c *C) { | |||
}{ | |||
// Test Index Join + UnionScan + TableScan. | |||
{ | |||
sql: "select /*+ TIDB_INLJ(t2) */ * from t t1, t t2 where t1.a = t2.a", | |||
best: "IndexJoin{TableReader(Table(t))->UnionScan([])->TableReader(Table(t))->UnionScan([])}(test.t1.a,test.t2.a)", | |||
sql: "select /*+ TIDB_INLJ(t1, t2) */ * from t t1, t t2 where t1.a = t2.a", |
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.
why changing the hint?
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.
Recovered.
…erge_join_in_physical_plan
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
/run-all-tests |
What problem does this PR solve?
A split pull request for #9571 .
What is changed and how it works?
Move the index_merge_join in planner.
Check List
Tests
Code changes
Side effects
Related changes