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: fix bug some cases index merge join hint doesn't work #15515

Merged
merged 8 commits into from
Mar 23, 2020

Conversation

lzmhhh123
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #15484

Problem Summary: As title says.

What is changed and how it works?

What's Changed: A hack change, you can check the comment in the code change.

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • Performance regression
    • Consumes more CPU

@lzmhhh123 lzmhhh123 added type/bugfix This PR fixes a bug. sig/planner SIG: Planner labels Mar 20, 2020
@lzmhhh123 lzmhhh123 requested a review from XuHuaiyu March 20, 2020 06:23
@lzmhhh123 lzmhhh123 requested a review from a team as a code owner March 20, 2020 06:23
@ghost ghost requested review from eurekaka and winoros and removed request for a team March 20, 2020 06:23
@XuHuaiyu
Copy link
Contributor

PTAL @eurekaka
Any better idea for fixing this issue?

break
}
}
// Index merge join has more strict conditions than index join and index hash join,
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. IndexMergeJoin requires stricter conditions than Index(Hash)Join when the output order is needed.
  2. IndexMergeJoin requires looser conditions than Index(Hash)Join when the output is unordered.
  3. If ordered-Index(Hash)Join can be chosen but ordered-IndexMergeJoin can not be chosen, we can build a plan with an enforced sort on IndexMergeJoin.
  4. Thus we can give up the plans here if IndexMergeJoin is nil when hasINLMJHint is true. Because we can make sure that an IndexMeregJoin with enforced sort will be built.

@codecov
Copy link

codecov bot commented Mar 23, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@21ee980). Click here to learn what that means.
The diff coverage is 80%.

@@             Coverage Diff             @@
##             master     #15515   +/-   ##
===========================================
  Coverage          ?   80.3874%           
===========================================
  Files             ?        502           
  Lines             ?     133970           
  Branches          ?          0           
===========================================
  Hits              ?     107695           
  Misses            ?      17807           
  Partials          ?       8468

@lzmhhh123 lzmhhh123 added this to the v4.0.0-rc milestone Mar 23, 2020
@XuHuaiyu
Copy link
Contributor

LGTM

@XuHuaiyu
Copy link
Contributor

PTAL @eurekaka

Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

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

LGTM

@lzmhhh123 lzmhhh123 added the status/can-merge Indicates a PR has been approved by a committer. label Mar 23, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 23, 2020

Your auto merge job has been accepted, waiting for 15478

@sre-bot
Copy link
Contributor

sre-bot commented Mar 23, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Mar 23, 2020

@lzmhhh123 merge failed.

@lzmhhh123 lzmhhh123 added status/can-merge Indicates a PR has been approved by a committer. and removed status/can-merge Indicates a PR has been approved by a committer. labels Mar 23, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 23, 2020

Your auto merge job has been accepted, waiting for 15507

@sre-bot
Copy link
Contributor

sre-bot commented Mar 23, 2020

/run-all-tests

@sre-bot sre-bot merged commit 7a09249 into pingcap:master Mar 23, 2020
@lzmhhh123 lzmhhh123 deleted the bug-fix/index_merge_join_hint branch March 23, 2020 10:05
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. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inl_merge_join doesn't work
4 participants