Skip to content

Conversation

@lcwangchao
Copy link
Collaborator

@lcwangchao lcwangchao commented Dec 9, 2025

What problem does this PR solve?

Issue Number: ref #62575

What changed and how does it work?

  • Introduce a new system variable tidb_index_lookup_pushdown_policy which has 3 options:

    • hint-only: The default value. Only push down the index lookup with hint INDEX_LOOKUP_PUSHDOWN
    • affinity-force: Force to push down the index lookup for tables with AFFINITY set.
    • force: Force to push down the index lookup for all tables.
  • Introduce a new hint NO_INDEX_LOOKUP_PUSHDOWN to disable index lookup for the current statement.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. sig/planner SIG: Planner labels Dec 9, 2025
@lcwangchao
Copy link
Collaborator Author

/hold before table affinity implemented

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 9, 2025
@lcwangchao lcwangchao mentioned this pull request Dec 9, 2025
20 tasks
@lcwangchao lcwangchao changed the title *: support system variable index_lookup_pushdown_mode and hint NO_INDEX_LOOKUP_PUSHDOWN *: support system variable tidb_index_lookup_pushdown_policy and hint NO_INDEX_LOOKUP_PUSHDOWN Dec 9, 2025
@lcwangchao lcwangchao force-pushed the tidb_lookup_pushdown_mode branch from d769802 to 48771f8 Compare December 9, 2025 08:31
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.7359%. Comparing base (4f42486) to head (5f05ef6).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #64932        +/-   ##
================================================
- Coverage   70.8840%   68.7359%   -2.1481%     
================================================
  Files          1889       1867        -22     
  Lines        516054     508009      -8045     
================================================
- Hits         365800     349185     -16615     
- Misses       125811     136536     +10725     
+ Partials      24443      22288      -2155     
Flag Coverage Δ
integration 41.6476% <100.0000%> (-6.4992%) ⬇️
unit 66.0045% <51.5789%> (+0.3730%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 39.1464% <ø> (-20.2237%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lcwangchao lcwangchao force-pushed the tidb_lookup_pushdown_mode branch from 48771f8 to f23cdb3 Compare December 9, 2025 09:39
@lcwangchao
Copy link
Collaborator Author

/retest

1 similar comment
@lcwangchao
Copy link
Collaborator Author

/retest

@lcwangchao lcwangchao force-pushed the tidb_lookup_pushdown_mode branch from 88fb4ca to 1b01e35 Compare December 10, 2025 03:16
@lcwangchao
Copy link
Collaborator Author

/retest

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 10, 2025
@lcwangchao lcwangchao force-pushed the tidb_lookup_pushdown_mode branch from 1b01e35 to 5f05ef6 Compare December 15, 2025 03:39
@lcwangchao
Copy link
Collaborator Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 15, 2025
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 15, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 15, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-12-10 14:39:36.657444038 +0000 UTC m=+1051921.471221610: ☑️ agreed by winoros.
  • 2025-12-15 03:43:38.222131491 +0000 UTC m=+1444563.035909053: ☑️ agreed by bb7133.

@lcwangchao
Copy link
Collaborator Author

/retest

Copy link

@yudongusa yudongusa left a comment

Choose a reason for hiding this comment

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

Please open a document PR

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 15, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, cfzjywxk, winoros, yudongusa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Dec 15, 2025
@lcwangchao
Copy link
Collaborator Author

Please open a document PR

It's here pingcap/docs-cn#20950, I'll complete it for the new variable and hint

@lcwangchao
Copy link
Collaborator Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 69fb8db into pingcap:master Dec 15, 2025
29 checks passed
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 15, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #65035.
But this PR has conflicts, please resolve them!

@lcwangchao lcwangchao deleted the tidb_lookup_pushdown_mode branch December 15, 2025 05:45
@lhy1024 lhy1024 mentioned this pull request Dec 15, 2025
13 tasks
ti-chi-bot bot pushed a commit that referenced this pull request Dec 20, 2025
kennedy8312 pushed a commit to kennedy8312/tidb-coderabbit that referenced this pull request Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants