Skip to content

docs: document partial indexes for ADD INDEX - #23928

Open
YangKeao wants to merge 1 commit into
pingcap:masterfrom
YangKeao:docs/add-index-partial-index
Open

YangKeao wants to merge 1 commit into
pingcap:masterfrom
YangKeao:docs/add-index-partial-index

Conversation

@YangKeao

@YangKeao YangKeao commented Sep 22, 2026

Copy link
Copy Markdown
Member

What is changed, added, or deleted? (Required)

Document partial-index syntax, scenarios, ALTER TABLE ... ADD INDEX examples, predicate behavior, and limitations on the ADD INDEX reference page.

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)
  • 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)

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

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

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
    • Updated the ADD INDEX reference to document partial indexes.
    • Added syntax support for WHERE predicates in index definitions.
    • Included usage scenarios, examples with EXPLAIN output, and documented limitations.

@ti-chi-bot

ti-chi-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

[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 assign lance6716 for approval. 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

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 22, 2026
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingcap/docs/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 400feee3-6a83-47a6-871d-cae4c2e0f0e7

📥 Commits

Reviewing files that changed from the base of the PR and between a343636 and e29277f.

📒 Files selected for processing (1)
  • sql-statements/sql-statement-add-index.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The ADD INDEX reference now includes WHERE predicates in its grammar and documents partial indexes, including syntax, examples, EXPLAIN output, supported predicates, and limitations.

Changes

Partial index documentation

Layer / File(s) Summary
Partial index syntax and reference
sql-statements/sql-statement-add-index.md
The IndexOption grammar accepts a WHERE expression. A new section documents partial and partial unique indexes, examples, query plans, supported predicates, type requirements, table references, and expression-index limitations.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to e2927

This documentation-only change is safe to merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: documenting partial indexes for ADD INDEX.
Description check ✅ Passed The description includes the required change summary, affected TiDB versions, related documentation link, AI involvement, and change-category checklist. The first-time contributor section is optional …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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 a new PR

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.

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 22, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-09-22 11:14:32.212819774 +0000 UTC m=+103397.438040881: ☑️ agreed by dveeden.

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

Labels

missing-translation-status This PR does not have translation status info. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants