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 hint for IndexHashJoin and IndexMergeJoin #13238

Merged
merged 19 commits into from Nov 13, 2019

Conversation

XuHuaiyu
Copy link
Contributor

@XuHuaiyu XuHuaiyu commented Nov 7, 2019

What problem does this PR solve?

1. fix issue #12309
2. support hint for IndexHashJoin and IndexMergeJoin

What is changed and how it works?

Check List

Tests

  • Integration test

Code changes

N/A

Side effects

N/A

Related changes

N/A

Release note

N/A

@codecov
Copy link

codecov bot commented Nov 8, 2019

Codecov Report

Merging #13238 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13238   +/-   ##
===========================================
  Coverage   80.5742%   80.5742%           
===========================================
  Files           471        471           
  Lines        115419     115419           
===========================================
  Hits          92998      92998           
  Misses        15352      15352           
  Partials       7069       7069

cmd/explaintest/r/explain_complex.result Outdated Show resolved Hide resolved
cmd/explaintest/r/tpch.result Outdated Show resolved Hide resolved
planner/core/exhaust_physical_plans.go Show resolved Hide resolved
planner/core/logical_plan_builder.go Outdated Show resolved Hide resolved
@XuHuaiyu
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

if rightJoins != nil && (rightOuter && !leftOuter || rhsCardinality < lhsCardinality) {
return rightJoins, rightOuter
switch {
case p.JoinType == InnerJoin && p.Children()[0].statsInfo().Count() < p.Children()[1].statsInfo().Count():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I don't think it's always a better choice for the situation to force left outers. What about remove the second condition?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we can get both sides inner join.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll affect many plans, using an individual PR is better. This issue traces it.

Copy link
Member

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please revert the change of go.sum. I'll approve the PR.

@lzmhhh123 lzmhhh123 added the status/LGT2 Indicates that a PR has LGTM 2. label Nov 13, 2019
@lzmhhh123 lzmhhh123 added the status/can-merge Indicates a PR has been approved by a committer. label Nov 13, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 13, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Nov 13, 2019

@XuHuaiyu merge failed.

@ngaut ngaut merged commit 2baaf1f into pingcap:master Nov 13, 2019
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/new-feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants