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: chose outer table based on cost when both tables are specified in TIDB_INLJ #9579

Merged
merged 7 commits into from Mar 8, 2019

Conversation

Projects
None yet
5 participants
@zz-jason
Copy link
Member

zz-jason commented Mar 6, 2019

What problem does this PR solve?

fix #9577

What is changed and how it works?

only short circuit when only one table is specified in the Index Join Hint.

Check List

Tests

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

Related changes

  • Need to cherry-pick to the release branch
  • Need to be included in the release note
@zz-jason

This comment has been minimized.

Copy link
Member Author

zz-jason commented Mar 6, 2019

/run-all-tests

zz-jason added some commits Mar 6, 2019

@zz-jason

This comment has been minimized.

Copy link
Member Author

zz-jason commented Mar 6, 2019

/run-all-tests

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Mar 6, 2019

Codecov Report

Merging #9579 into master will decrease coverage by <.01%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9579      +/-   ##
==========================================
- Coverage   67.31%   67.31%   -0.01%     
==========================================
  Files         376      376              
  Lines       78969    78979      +10     
==========================================
+ Hits        53159    53162       +3     
- Misses      21057    21062       +5     
- Partials     4753     4755       +2
Impacted Files Coverage Δ
planner/core/logical_plans.go 75.84% <ø> (ø) ⬆️
planner/core/logical_plan_builder.go 78.98% <100%> (+0.02%) ⬆️
planner/core/planbuilder.go 49.08% <100%> (+0.32%) ⬆️
planner/core/exhaust_physical_plans.go 94.29% <90%> (+0.47%) ⬆️
ddl/session_pool.go 82.75% <0%> (-10.35%) ⬇️
ddl/delete_range.go 76.71% <0%> (-2.65%) ⬇️
store/tikv/lock_resolver.go 41.7% <0%> (-0.95%) ⬇️
executor/join.go 79.06% <0%> (-0.52%) ⬇️
executor/distsql.go 73.79% <0%> (-0.46%) ⬇️
executor/aggregate.go 78.9% <0%> (+0.21%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b00c207...a29371b. Read the comment docs.

@zz-jason zz-jason requested review from eurekaka and lamxTyler and removed request for eurekaka Mar 7, 2019

@eurekaka
Copy link
Contributor

eurekaka left a comment

LGTM

@eurekaka eurekaka added the status/LGT1 label Mar 8, 2019

@lamxTyler
Copy link
Member

lamxTyler left a comment

LGTM

@lamxTyler lamxTyler added status/LGT2 and removed status/LGT1 labels Mar 8, 2019

}

plans = append(plans, leftJoins...)
plans = append(plans, rightJoins...)
joins := append(leftJoins, rightJoins...)

This comment has been minimized.

@winoros

winoros Mar 8, 2019

Member

Is it necessary to go here?
The above two if branches should select the wanted choice already.

This comment has been minimized.

@zz-jason

zz-jason Mar 8, 2019

Author Member

if lhsCardinality == lhsCardinality, it's possible to reach this place.

@winoros winoros merged commit 85c4553 into pingcap:master Mar 8, 2019

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

zz-jason added a commit to zz-jason/tidb that referenced this pull request Mar 8, 2019

zz-jason added a commit that referenced this pull request Mar 11, 2019

@zz-jason zz-jason deleted the zz-jason:bugfix/index_join_hint branch Mar 18, 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.