tidb icon indicating copy to clipboard operation
tidb copied to clipboard

*: support system variable `tidb_index_lookup_pushdown_policy` and hint `NO_INDEX_LOOKUP_PUSHDOWN`

Open lcwangchao opened this issue 3 weeks ago • 7 comments

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
  • [x] 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

lcwangchao avatar Dec 09 '25 08:12 lcwangchao

/hold before table affinity implemented

lcwangchao avatar Dec 09 '25 08:12 lcwangchao

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 68.7359%. Comparing base (4f42486) to head (5f05ef6). :warning: 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%) :arrow_down:
unit 66.0045% <51.5789%> (+0.3730%) :arrow_up:

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%) :arrow_down:
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Dec 09 '25 08:12 codecov[bot]

/retest

lcwangchao avatar Dec 09 '25 10:12 lcwangchao

/retest

lcwangchao avatar Dec 09 '25 13:12 lcwangchao

/retest

lcwangchao avatar Dec 10 '25 04:12 lcwangchao

/unhold

lcwangchao avatar Dec 15 '25 03:12 lcwangchao

[LGTM Timeline notifier]

Timeline:

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

ti-chi-bot[bot] avatar Dec 15 '25 03:12 ti-chi-bot[bot]

/retest

lcwangchao avatar Dec 15 '25 04:12 lcwangchao

[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

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[bot] avatar Dec 15 '25 04:12 ti-chi-bot[bot]

Please open a document PR

It's here https://github.com/pingcap/docs-cn/pull/20950, I'll complete it for the new variable and hint

lcwangchao avatar Dec 15 '25 04:12 lcwangchao

/retest

lcwangchao avatar Dec 15 '25 05:12 lcwangchao

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

ti-chi-bot avatar Dec 15 '25 05:12 ti-chi-bot