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

proposal: access a table using multiple indexes #10121

Merged
merged 9 commits into from
May 13, 2019
Merged

proposal: access a table using multiple indexes #10121

merged 9 commits into from
May 13, 2019

Conversation

hailanwhu
Copy link
Contributor

What problem does this PR solve?

Related issue: #9019

In present TiDB, a SQL statement with conditions involving multiple indexed attributes only uses one of the conditions as the index filter to build access condition, while others are regarded as table filters.But in some cases, it will be better with multiple indexes.

What is changed and how it works?

(1) generate possible access paths using multiple indexes.
(2) using cost model to determine whether to use multiple indexes. We call it IndexMerge like MySQL
(3) if choose IndexMergePath, generate a physical plan and execute.

@eurekaka eurekaka changed the title access a table using multiple indexes proposal: access a table using multiple indexes Apr 12, 2019
@eurekaka eurekaka added sig/execution SIG execution sig/planner SIG: Planner proposal labels Apr 12, 2019
docs/design/2019-04-11-indexmerge.md Outdated Show resolved Hide resolved
docs/design/2019-04-11-indexmerge.md Show resolved Hide resolved
docs/design/2019-04-11-indexmerge.md Show resolved Hide resolved
docs/design/2019-04-11-indexmerge.md Show resolved Hide resolved
docs/design/2019-04-11-indexmerge.md Outdated Show resolved Hide resolved
docs/design/2019-04-11-indexmerge.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented May 9, 2019

Codecov Report

Merging #10121 into master will decrease coverage by 0.0607%.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             master     #10121        +/-   ##
================================================
- Coverage   77.1071%   77.0463%   -0.0608%     
================================================
  Files           412        412                
  Lines         86337      86348        +11     
================================================
- Hits          66572      66528        -44     
- Misses        14675      14728        +53     
- Partials       5090       5092         +2

@zhouqiang-cl
Copy link
Contributor

/rebuild

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. We can merge this proposal first and ask help of I18N team to polish words later.

@eurekaka eurekaka added the status/LGT1 Indicates that a PR has LGTM 1. label May 13, 2019
@eurekaka eurekaka requested a review from zz-jason May 13, 2019 03:44
docs/design/2019-04-11-indexmerge.md Outdated Show resolved Hide resolved
docs/design/2019-04-11-indexmerge.md Outdated Show resolved Hide resolved
docs/design/2019-04-11-indexmerge.md Outdated Show resolved Hide resolved
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 13, 2019
@zz-jason zz-jason merged commit 373317f into pingcap:master May 13, 2019
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. proposal sig/execution SIG execution sig/planner SIG: Planner status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants