-
Notifications
You must be signed in to change notification settings - Fork 709
Add index lookup push down content #22196
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
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello @Oreoxmt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates new documentation for advanced query optimization features in TiDB. It introduces specific optimizer hints and a system variable designed to manage the pushdown of Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds documentation for the new INDEX_LOOKUP_PUSHDOWN feature, including optimizer hints and a related system variable. The documentation is well-written and clear. My feedback includes several minor suggestions to improve formatting and ensure consistency with the style guide, primarily by adding backticks to code-related terms and correcting list formatting.
| +-----------------------------+----------+-----------+----------------------+--------------------------------+ | ||
| ``` | ||
|
|
||
| When the `INDEX_LOOKUP_PUSHDOWN` hint is enabled, the outermost Build operator that originally runs on the TiDB side in the execution plan is replaced with `LocalIndexLookUp`, which is then pushed down to TiKV for execution. While scanning the index, TiKV attempts to read row data by performing local table lookups. Because the index and row data might be distributed across different Regions, the pushdown request might not cover all target rows. Therefore, TiDB retains the `TableRowIDScan` operator to fetch any rows that are not matched on the TiKV side. |
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.
To improve readability and maintain consistency with the style guide, please wrap the hint name and operator names in backticks.
| When the `INDEX_LOOKUP_PUSHDOWN` hint is enabled, the outermost Build operator that originally runs on the TiDB side in the execution plan is replaced with `LocalIndexLookUp`, which is then pushed down to TiKV for execution. While scanning the index, TiKV attempts to read row data by performing local table lookups. Because the index and row data might be distributed across different Regions, the pushdown request might not cover all target rows. Therefore, TiDB retains the `TableRowIDScan` operator to fetch any rows that are not matched on the TiKV side. | |
| When the `INDEX_LOOKUP_PUSHDOWN` hint is enabled, the outermost `Build` operator that originally runs on the TiDB side in the execution plan is replaced with `LocalIndexLookUp`, which is then pushed down to TiKV for execution. While scanning the index, TiKV attempts to read row data by performing local table lookups. Because the index and row data might be distributed across different Regions, the pushdown request might not cover all target rows. Therefore, TiDB retains the `TableRowIDScan` operator to fetch any rows that are not matched on the TiKV side. |
References
- Code snippets, command names, options, and paths should be in backticks. (link)
optimizer-hints.md
Outdated
| * Isolation levels other than `REPEATABLE-READ` are not supported. | ||
| - [Follower Read](/follower-read.md) is not supported. | ||
| - [Stale Read](/stale-read.md) and [reading historical data using `tidb_snapshot`](/read-historical-data.md) are not supported. | ||
| * The pushed-down `LocalIndexLookUp` operator does not support keep order. If the execution plan includes an `ORDER BY` clause on index columns, the query falls back to regular `IndexLookUp`. | ||
| * The pushed-down `LocalIndexLookUp` operator does not support sending Coprocessor requests in pagination mode. | ||
| * The pushed-down `LocalIndexLookUp` operator does not support [Coprocessor Cache](/coprocessor-cache.md). |
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.
I've made a few adjustments for consistency and clarity:
- Changed the bullet points from
-to*to maintain a consistent list format. - Wrapped technical terms like
tidb_snapshot,LocalIndexLookUp,ORDER BY,IndexLookUp, andCoprocessorin backticks as per the style guide.
| * Isolation levels other than `REPEATABLE-READ` are not supported. | |
| - [Follower Read](/follower-read.md) is not supported. | |
| - [Stale Read](/stale-read.md) and [reading historical data using `tidb_snapshot`](/read-historical-data.md) are not supported. | |
| * The pushed-down `LocalIndexLookUp` operator does not support keep order. If the execution plan includes an `ORDER BY` clause on index columns, the query falls back to regular `IndexLookUp`. | |
| * The pushed-down `LocalIndexLookUp` operator does not support sending Coprocessor requests in pagination mode. | |
| * The pushed-down `LocalIndexLookUp` operator does not support [Coprocessor Cache](/coprocessor-cache.md). | |
| * Isolation levels other than `REPEATABLE-READ` are not supported. | |
| * [Follower Read](/follower-read.md) is not supported. | |
| * [Stale Read](/stale-read.md) and [reading historical data using `tidb_snapshot`](/read-historical-data.md) are not supported. | |
| * The pushed-down `LocalIndexLookUp` operator does not support keep order. If the execution plan includes an `ORDER BY` clause on index columns, the query falls back to regular `IndexLookUp`. | |
| * The pushed-down `LocalIndexLookUp` operator does not support sending `Coprocessor` requests in pagination mode. | |
| * The pushed-down `LocalIndexLookUp` operator does not support [Coprocessor Cache](/coprocessor-cache.md). |
| - This variable is used to set the concurrency of the `index lookup join` algorithm. | ||
| - A value of `-1` means that the value of `tidb_executor_concurrency` will be used instead. | ||
|
|
||
| ### tidb_index_lookup_pushdown_policy <span class="version-mark">New in v8.5.5 and v9.0.0</span> |
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.
To follow the style guide, please wrap the system variable name in the heading with backticks.
| ### tidb_index_lookup_pushdown_policy <span class="version-mark">New in v8.5.5 and v9.0.0</span> | |
| ### `tidb_index_lookup_pushdown_policy` <span class="version-mark">New in v8.5.5 and v9.0.0</span> |
References
- Code snippets, command names, options, and paths should be in backticks. (link)
|
/hold |
|
/cc @qiancai |
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?