-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Conversation
Codecov Report
@@ 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 |
/rebuild |
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.