Skip to content

docs: clarify HYPO_INDEX scope in index advisor (#23304)#23308

Merged
ti-chi-bot[bot] merged 4 commits into
pingcap:masterfrom
ti-chi-bot:cherry-pick-23304-to-master
Jul 20, 2026
Merged

docs: clarify HYPO_INDEX scope in index advisor (#23304)#23308
ti-chi-bot[bot] merged 4 commits into
pingcap:masterfrom
ti-chi-bot:cherry-pick-23304-to-master

Conversation

@ti-chi-bot

@ti-chi-bot ti-chi-bot commented Jul 20, 2026

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #23304

What is changed, added or deleted? (Required)

Users who see HYPO_INDEX written in the /*+ ... */ syntax might assume that a hypothetical index is a conventional optimizer hint. They might then look for HYPO_INDEX in the Optimizer Hints reference and be unsure why it is not listed there. The existing Index Advisor description does not clearly distinguish the hypothetical index being evaluated from the HYPO_INDEX hint used to define it.

This PR updates index-advisor.md for TiDB Cloud to:

  • distinguish a hypothetical index from the special-purpose HYPO_INDEX hint that defines it
  • clarify that HYPO_INDEX takes effect only in EXPLAIN statements and does not create a physical index
  • introduce the example as an EXPLAIN use case, consistent with the SQL shown

These changes help users understand how HYPO_INDEX relates to optimizer hints and when to use it to evaluate an index design before creating a real index.

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.

  • master (the latest development version)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.2 (TiDB 8.2 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)
  • v5.3 (TiDB 5.3 versions)

What is the related PR or file 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

Summary by CodeRabbit

  • Documentation
    • Clarified how to use the /*+ HYPO_INDEX(...) */ syntax in EXPLAIN statements.
    • Updated explanations of hypothetical indexes, including their use in “What-If” analysis and experimentation.
    • Refined the introductory text for the hypothetical index example.

@ti-chi-bot ti-chi-bot added area/tidb-cloud This PR relates to the area of TiDB Cloud. contribution This PR is from a community contributor. lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/bugfix This PR fixes a bug. type/cherry-pick-for-master This PR is cherry-picked to master from a source PR. labels Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f5a90a8d-6519-41d6-a5a0-2aa8546e13f9

📥 Commits

Reviewing files that changed from the base of the PR and between c8064bb and b38dcd4.

📒 Files selected for processing (1)
  • index-advisor.md

📝 Walkthrough

Walkthrough

The hypothetical indexes documentation was revised to explain the /*+ HYPO_INDEX(...) */ syntax in EXPLAIN statements and update the accompanying example introduction.

Changes

Hypothetical index documentation

Layer / File(s) Summary
EXPLAIN syntax documentation
index-advisor.md
The “Hypothetical indexes” section now emphasizes using HYPO_INDEX within EXPLAIN and describes the example as an EXPLAIN statement using a hypothetical index.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the doc clarification about HYPO_INDEX scope in index advisor.
Description check ✅ Passed The description covers the change, affected version, related links, and context well enough for the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qiancai

qiancai commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

/approve

@ti-chi-bot

ti-chi-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiancai

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 Jul 20, 2026
@ti-chi-bot
ti-chi-bot Bot merged commit 6c86453 into pingcap:master Jul 20, 2026
12 checks passed
@ti-chi-bot
ti-chi-bot Bot deleted the cherry-pick-23304-to-master branch July 20, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved area/tidb-cloud This PR relates to the area of TiDB Cloud. contribution This PR is from a community contributor. lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/bugfix This PR fixes a bug. type/cherry-pick-for-master This PR is cherry-picked to master from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants