Skip to content

ttl: document index scans for TTL jobs - #21927

Open
YangKeao wants to merge 8 commits into
pingcap:masterfrom
YangKeao:pr-68397-ttl-index-scan
Open

ttl: document index scans for TTL jobs#21927
YangKeao wants to merge 8 commits into
pingcap:masterfrom
YangKeao:pr-68397-ttl-index-scan

Conversation

@YangKeao

@YangKeao YangKeao commented Sep 10, 2026

Copy link
Copy Markdown
Member

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

Translate the TTL index scan documentation from pingcap/docs#23813.

Which TiDB version(s) do your changes apply to? (Required)

  • 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

  • 文档
    • 新增系统变量 tidb_ttl_enable_index_scan,默认值为 ON,用于控制 TTL 任务是否使用符合条件的索引扫描。
    • 补充 TTL 过期行索引扫描的适用条件及索引要求。
    • 说明关闭该变量或无可用索引时,将回退为按表键顺序扫描。
    • 补充 mysql.tidb_ttl_taskscan_index_id 字段的含义,用于识别任务采用的扫描方式。

@YangKeao YangKeao added the translation/from-docs This PR is translated from a PR in pingcap/docs. label Sep 10, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 10, 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 icemap 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 the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 10, 2026
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

新增 TTL 索引扫描系统变量文档,说明索引使用条件、关闭变量或无匹配索引时的回退行为,并补充 TTL 任务表中的 scan_index_id 字段说明。

Changes

TTL 索引扫描文档

Layer / File(s) Summary
系统变量定义与引用
system-variables.md, system-variable-reference.md
新增 tidb_ttl_enable_index_scan。文档说明其全局作用域、集群持久化属性、默认值和关闭后的扫描行为,并加入参考链接。
TTL 索引扫描行为
time-to-live.md
新增索引扫描条件、回退规则和优化器限制说明。补充 mysql.tidb_ttl_task.scan_index_id 的字段含义。

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

Suggested reviewers: qiancai, oreoxmt, ti-chi-bot

Merge Risk: 🔵 Low · up to 5cf35

该文档新增 TTL 索引扫描规则,但索引类型术语存在误译和遗漏,可能导致用户错误判断某个索引是否会被 TTL 使用;应修正后合并。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题简洁明确,准确概括了为 TTL 任务补充索引扫描文档的主要变更。
Description check ✅ Passed 描述已填写变更内容、适用版本、相关 PR 和 AI agent involvement。必需信息完整,未发现影响审核的信息缺失。
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 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c183a37c-07e4-4b8d-bd2a-317bc26a4dab

📥 Commits

Reviewing files that changed from the base of the PR and between 2ea9341 and 5cf35a3.

📒 Files selected for processing (2)
  • system-variables.md
  • time-to-live.md

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

Comment thread time-to-live.md Outdated
Comment thread time-to-live.md Outdated
Comment thread time-to-live.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files. translation/from-docs This PR is translated from a PR in pingcap/docs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants