Skip to content

Add new session variable "tidb_opt_partial_ordered_index_for_topn"#21318

Open
elsa0520 wants to merge 16 commits intopingcap:masterfrom
elsa0520:partial_order_by
Open

Add new session variable "tidb_opt_partial_ordered_index_for_topn"#21318
elsa0520 wants to merge 16 commits intopingcap:masterfrom
elsa0520:partial_order_by

Conversation

@elsa0520
Copy link
Copy Markdown
Contributor

@elsa0520 elsa0520 commented Feb 5, 2026

First-time contributors' checklist

What is changed, added or deleted? (Required)

Explain the new session variable "tidb_opt_partial_ordered_index_for_topn" in sys-var doc

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 (in Chinese).

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

Related issue: pingcap/tidb#65813

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 5, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Feb 6, 2026

@AilinKid: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Feb 7, 2026

@hawkingrei: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@qiancai qiancai self-assigned this Feb 10, 2026
@qiancai qiancai added the translation/doing This PR’s assignee is translating this PR. label Feb 10, 2026
@ti-chi-bot ti-chi-bot bot removed the missing-translation-status This PR does not have translation status info. label Feb 10, 2026
Copy link
Copy Markdown
Collaborator

@qiancai qiancai left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 25, 2026
Co-authored-by: Grace Cai <qqzczy@126.com>
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Feb 25, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from qiancai. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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

elsa0520 and others added 6 commits February 25, 2026 17:33
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
@qiancai qiancai added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Feb 26, 2026
github-actions bot added a commit to qiancai/docs that referenced this pull request Feb 26, 2026
Synced from: pingcap/docs-cn#21318
Target PR: pingcap#22495
AI Provider: gemini

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
```sql
> SET SESSION tidb_opt_partial_ordered_index_for_topn = 'COST';

> EXPLAIN FORMAT='brief' SELECT /*+ use_index(t_varchar, idx_name_prefix) */ *
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we also add the create-table statement here? Otherwise, we don't know what this index idx_name_prefix looks like.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

added in 14be16f.

@qiancai qiancai added the v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3. label Mar 2, 2026
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 3, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 3, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-02-25 07:49:17.816649991 +0000 UTC m=+254830.331444600: ☑️ agreed by qiancai.
  • 2026-04-03 03:47:36.257464558 +0000 UTC m=+496061.462824615: ☑️ agreed by Oreoxmt.

Co-authored-by: Aolin <aolinz@outlook.com>
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 10, 2026

@elsa0520: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-verify caf9846 link true /test pull-verify

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. translation/doing This PR’s assignee is translating this PR. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants