Skip to content

tidb: document analyze v1 removal#21599

Open
qiancai wants to merge 6 commits intopingcap:masterfrom
qiancai:poe-patch-analyze-v1-master-docs-22655
Open

tidb: document analyze v1 removal#21599
qiancai wants to merge 6 commits intopingcap:masterfrom
qiancai:poe-patch-analyze-v1-master-docs-22655

Conversation

@qiancai
Copy link
Copy Markdown
Collaborator

@qiancai qiancai commented Apr 29, 2026

What is changed, added or deleted? (Required)

Document on master that Statistics Version 1 (tidb_analyze_version = 1) is no longer supported for new statistics collection. Update the statistics, system variable, and analyze status docs to describe the legacy read-only compatibility path and the migration and upgrade behavior.

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)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 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

@qiancai qiancai added translation/from-docs This PR is translated from a PR in pingcap/docs. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3. labels Apr 29, 2026
@ti-chi-bot ti-chi-bot Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 29, 2026
Synced from: pingcap/docs#22655
Target PR: pingcap#21599
AI Provider: azure

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Auto-sync completed successfully

Source PR: pingcap/docs#22655
Target PR: #21599

Chinese documentation has been updated based on English documentation changes.

@github-actions github-actions Bot force-pushed the poe-patch-analyze-v1-master-docs-22655 branch from 7380890 to 1768a68 Compare April 29, 2026 09:08
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 29, 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 assign qiancai 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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 29, 2026
Comment thread information-schema/information-schema-analyze-status.md Outdated
Comment thread information-schema/information-schema-analyze-status.md Outdated
Comment thread sql-statements/sql-statement-show-analyze-status.md Outdated
Comment thread sql-statements/sql-statement-show-analyze-status.md Outdated
Comment thread statistics.md Outdated
Comment thread statistics.md Outdated
Comment thread statistics.md Outdated
Comment thread system-variables.md Outdated
Comment thread system-variables.md Outdated
Comment thread system-variables.md Outdated
@ti-chi-bot ti-chi-bot Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 29, 2026
@qiancai
Copy link
Copy Markdown
Collaborator Author

qiancai commented Apr 29, 2026

/bot-review

Comment thread information-schema/information-schema-analyze-status.md
Comment thread sql-statements/sql-statement-show-analyze-status.md
Comment thread sql-statements/sql-statement-show-analyze-status.md
Comment thread sql-statements/sql-statement-show-analyze-status.md
Comment thread sql-statements/sql-statement-show-analyze-status.md
Comment thread statistics.md
Comment thread system-variables.md Outdated

> **警告:**
>
> 从 v9.0.0 起,TiDB 不再支持使用统计信息版本 1(`tidb_analyze_version = 1`)收集新的统计信息。如果你尝试将此变量设置为 `1`,TiDB 会返回错误。出于升级兼容性考虑,TiDB 仍支持读取现有的版本 1 的统计信息,但所有新的 `ANALYZE` 操作都使用统计信息版本 2(`tidb_analyze_version = 2`)。建议使用 `tidb_analyze_version = 2`。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

警告信息中“不再支持使用统计信息版本 1”的表述不够精确,建议明确说明是“不再支持使用统计信息版本 1 收集新的统计信息”。同时,建议将“出于升级兼容性考虑”改为“为了升级兼容性”,使语句更通顺。

Suggested change
> 从 v9.0.0 起,TiDB 不再支持使用统计信息版本 1(`tidb_analyze_version = 1`)收集新的统计信息。如果你尝试将此变量设置为 `1`,TiDB 会返回错误。出于升级兼容性考虑,TiDB 仍支持读取现有的版本 1 的统计信息,但所有新的 `ANALYZE` 操作都使用统计信息版本 2(`tidb_analyze_version = 2`)。建议使用 `tidb_analyze_version = 2`
> 从 v9.0.0 起,TiDB 不再支持使用统计信息版本 1(`tidb_analyze_version = 1`)收集新的统计信息。如果你尝试将此变量设置为 `1`,TiDB 会返回错误。为了升级兼容性,TiDB 仍支持读取现有的版本 1 的统计信息,但所有新的 `ANALYZE` 操作都使用统计信息版本 2(`tidb_analyze_version = 2`)。建议使用 `tidb_analyze_version = 2`

Comment thread system-variables.md Outdated
- 类型:整数型
- 默认值:`2`
- 这个变量用于控制 TiDB 收集统计信息的行为。
- 对于 TiDB Self-Managed,从 v5.3.0 开始,此变量的默认值已从 `1` 更改为 `2`。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

“TiDB Self-Managed” 和 “TiDB Cloud” 的表述不够清晰,建议改为更通用的“自管理 TiDB 集群”和“TiDB Cloud”。

Suggested change
- 对于 TiDB Self-Managed,从 v5.3.0 开始,此变量的默认值已从 `1` 更改为 `2`。
- 对于自管理 TiDB 集群,从 v5.3.0 开始,此变量的默认值已从 `1` 更改为 `2`。

Comment thread system-variables.md Outdated
- 默认值:`2`
- 这个变量用于控制 TiDB 收集统计信息的行为。
- 对于 TiDB Self-Managed,从 v5.3.0 开始,此变量的默认值已从 `1` 更改为 `2`。
- 对于 TiDB Cloud,从 v6.5.0 开始,此变量的默认值已从 `1` 更改为 `2`。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

同上,建议将 “TiDB Cloud” 改为更通用的表述。

Suggested change
- 对于 TiDB Cloud,从 v6.5.0 开始,此变量的默认值已从 `1` 更改为 `2`。
- 对于 TiDB Cloud,从 v6.5.0 开始,此变量的默认值已从 `1` 更改为 `2`。

Comment thread system-variables.md Outdated
- 这个变量用于控制 TiDB 收集统计信息的行为。
- 对于 TiDB Self-Managed,从 v5.3.0 开始,此变量的默认值已从 `1` 更改为 `2`。
- 对于 TiDB Cloud,从 v6.5.0 开始,此变量的默认值已从 `1` 更改为 `2`。
- 如果要升级的集群已经持久化 `tidb_analyze_version = 1` 配置,TiDB 会在升级期间将持久化的全局值重写为 `2`。请注意,升级后,现有的版本 1 统计信息不会自动转换为版本 2 统计信息。建议你[将使用统计信息版本 1 的现有对象迁移到版本 2](/statistics.md#切换统计信息版本)。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

“如果要升级的集群已经持久化 tidb_analyze_version = 1 配置” 表述可以更清晰,建议改为“如果待升级的集群已持久化 tidb_analyze_version = 1 配置”。

Suggested change
- 如果要升级的集群已经持久化 `tidb_analyze_version = 1` 配置,TiDB 会在升级期间将持久化的全局值重写为 `2`。请注意,升级后,现有的版本 1 统计信息不会自动转换为版本 2 统计信息。建议你[将使用统计信息版本 1 的现有对象迁移到版本 2](/statistics.md#切换统计信息版本)。
- 如果待升级的集群已持久化 `tidb_analyze_version = 1` 配置,TiDB 会在升级期间将持久化的全局值重写为 `2`。请注意,升级后,现有的版本 1 统计信息不会自动转换为版本 2 统计信息。建议你[将使用统计信息版本 1 的现有对象迁移到版本 2](/statistics.md#切换统计信息版本)。

@github-actions
Copy link
Copy Markdown

✅ AI review completed, 20 comments generated.

@ti-chi-bot ti-chi-bot Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 29, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Comment thread statistics.md Outdated
Comment thread statistics.md Outdated
@qiancai qiancai self-assigned this May 8, 2026
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. 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.

1 participant