Skip to content
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

Merged

Conversation

@lzmhhh123
Copy link
Member

commented Jul 19, 2019

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

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Possible performance regression
  • Increased code complexity

Related changes

  • None
@codecov

This comment has been minimized.

Copy link

commented Jul 19, 2019

Codecov Report

Merging #11338 into master will decrease coverage by 0.2554%.
The diff coverage is 100%.

@@               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

@lzmhhh123 lzmhhh123 requested review from eurekaka, XuHuaiyu and zz-jason Jul 19, 2019

planner/core/physical_plans.go Outdated Show resolved Hide resolved
planner/core/stringer.go Show resolved Hide resolved
planner/core/exhaust_physical_plans.go Outdated Show resolved Hide resolved

@qw4990 qw4990 self-requested a review Jul 24, 2019

lzmhhh123 added 3 commits Jul 31, 2019
fix

@lzmhhh123 lzmhhh123 requested review from winoros and zz-jason Aug 1, 2019

@lzmhhh123 lzmhhh123 force-pushed the lzmhhh123:dev/support_index_merge_join_in_physical_plan branch from e6cf850 to 38a0de2 Aug 1, 2019

planner/core/exhaust_physical_plans.go Outdated Show resolved Hide resolved
planner/core/exhaust_physical_plans.go Outdated Show resolved Hide resolved
planner/core/exhaust_physical_plans.go Outdated Show resolved Hide resolved
planner/core/exhaust_physical_plans.go Outdated Show resolved Hide resolved
planner/core/exhaust_physical_plans.go Outdated Show resolved Hide resolved
planner/core/task.go Outdated Show resolved Hide resolved

@lzmhhh123 lzmhhh123 force-pushed the lzmhhh123:dev/support_index_merge_join_in_physical_plan branch from e64ebc4 to 05b6b5b Aug 1, 2019

@zz-jason zz-jason requested review from zz-jason and qw4990 Aug 5, 2019

@zz-jason zz-jason added the status/PTAL label Aug 5, 2019

planner/core/exhaust_physical_plans.go Outdated Show resolved Hide resolved
planner/core/exhaust_physical_plans.go Outdated Show resolved Hide resolved

@zz-jason zz-jason removed their request for review Aug 8, 2019

lzmhhh123 and others added 3 commits Aug 23, 2019
commit suggestion
Co-Authored-By: Kenan Yao <cauchy1992@gmail.com>
commit suggestion
Co-Authored-By: Kenan Yao <cauchy1992@gmail.com>
commit suggestion
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

This comment has been minimized.

Copy link
@zz-jason

zz-jason Aug 24, 2019

Member

It's wried, it should be a Limit operator?

This comment has been minimized.

Copy link
@lzmhhh123

lzmhhh123 Aug 26, 2019

Author Member

It's the result of rule_topn_push_down.

@sre-bot

This comment has been minimized.

Copy link

commented Aug 28, 2019

1 similar comment
@sre-bot

This comment has been minimized.

Copy link

commented Aug 30, 2019

lzmhhh123 added 2 commits Aug 30, 2019

@lzmhhh123 lzmhhh123 requested a review from zz-jason Aug 30, 2019

@sre-bot

This comment has been minimized.

Copy link

commented Sep 2, 2019

@qw4990 qw4990 removed their request for review Sep 2, 2019

@@ -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++

This comment has been minimized.

Copy link
@zz-jason

zz-jason Sep 2, 2019

Member

We can call p.PhysicalIndexJoin.Init(ctx), then reset p.tp.

This comment has been minimized.

Copy link
@lzmhhh123

lzmhhh123 Sep 2, 2019

Author Member

PhysicalIndexJoin.Init(ctx) news a new basePlan. I think that's unnecessary.

@@ -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",

This comment has been minimized.

Copy link
@zz-jason

zz-jason Sep 2, 2019

Member

why changing the hint?

This comment has been minimized.

Copy link
@lzmhhh123

lzmhhh123 Sep 3, 2019

Author Member

Recovered.

@XuHuaiyu XuHuaiyu referenced this pull request Sep 3, 2019

@lzmhhh123 lzmhhh123 requested review from zz-jason and lamxTyler Sep 3, 2019

log.txt Outdated Show resolved Hide resolved

@lzmhhh123 lzmhhh123 requested a review from lamxTyler Sep 4, 2019

@lamxTyler
Copy link
Member

left a comment

LGTM

@sre-bot

This comment has been minimized.

Copy link

commented Sep 4, 2019

/run-all-tests

@sre-bot sre-bot merged commit 8450613 into pingcap:master Sep 4, 2019

13 checks passed

idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/build_check_race Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev_2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/common-test job succeeded
Details
idc-jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-compatibility-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/mybatis-test job succeeded
Details
idc-jenkins-ci-tidb/sqllogic-test-1 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/sqllogic-test-2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@lzmhhh123 lzmhhh123 deleted the lzmhhh123:dev/support_index_merge_join_in_physical_plan branch Sep 4, 2019

jingyugao added a commit to jingyugao/tidb that referenced this pull request Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.