Skip to content

statistics: deprecate stats v1 in 8.5 docs#21476

Open
qiancai wants to merge 9 commits intopingcap:release-8.5from
qiancai:poe-patch-stats-v1-8.5-22624
Open

statistics: deprecate stats v1 in 8.5 docs#21476
qiancai wants to merge 9 commits intopingcap:release-8.5from
qiancai:poe-patch-stats-v1-8.5-22624

Conversation

@qiancai
Copy link
Copy Markdown
Collaborator

@qiancai qiancai commented Mar 27, 2026

What is changed, added or deleted? (Required)

Document that Statistics Version 1 (tidb_analyze_version = 1) is deprecated and will be removed in a future release across the statistics, ANALYZE, and analyze status docs. Align the migration query examples with v1 -> v2 migration.

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

  • 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

@qiancai qiancai added the translation/from-docs This PR is translated from a PR in pingcap/docs. label Mar 27, 2026
@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 27, 2026
github-actions bot added a commit to qiancai/docs-cn that referenced this pull request Mar 27, 2026
Synced from: pingcap/docs#22624
Target PR: pingcap#21476
AI Provider: gemini

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@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 Mar 27, 2026
@qiancai qiancai closed this Mar 27, 2026
@qiancai qiancai force-pushed the poe-patch-stats-v1-8.5-22624 branch from 6fe87f9 to 0c164d8 Compare March 27, 2026 11:08
@ti-chi-bot ti-chi-bot bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 27, 2026
@qiancai qiancai reopened this Mar 27, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Mar 27, 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 jackysp 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/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 27, 2026
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 28, 2026
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 28, 2026
@qiancai qiancai self-assigned this Mar 30, 2026
@qiancai qiancai added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Mar 30, 2026
@qiancai
Copy link
Copy Markdown
Collaborator Author

qiancai commented Mar 30, 2026

/cc @0xPoe

@ti-chi-bot ti-chi-bot bot requested a review from 0xPoe March 30, 2026 08:17
Copy link
Copy Markdown
Member

@0xPoe 0xPoe left a comment

Choose a reason for hiding this comment

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

Thanks! :shipit:

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Mar 30, 2026

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

Details

In response to this:

Thanks! :shipit:

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.

建议所有表、索引和分区使用相同的统计信息版本。如果你的集群仍在使用统计信息版本 1,请尽快迁移至统计信息版本 2。在为某个对象(例如表、索引或分区)收集到 Version 2 的统计信息之前,TiDB 会继续使用该对象现有的 Version 1 统计信息

切换版本的正当理由可能包括:使用 Version 1 在收集 Count-Min Sketch 统计信息时,由于哈希冲突导致等值查询或 `IN` 查询谓词估算不准确。此时,你可以参考 [Count-Min Sketch](#count-min-sketch) 小节中描述的解决方案,或者设置 `tidb_analyze_version = 2` 并对所有对象重新运行 `ANALYZE`。在 Version 2 的早期阶段,执行 `ANALYZE` 后有内存溢出的风险,现在这个问题已经解决,但最初的解决方案是设置 `tidb_analyze_version = 1` 并对所有对象重新运行 `ANALYZE`。
迁移的一个主要原因是,版本 1 可能对等值/IN 谓词产生不准确的估算,因为 Count-Min sketch 可能存在哈希冲突。更多信息,请参阅 [Count-Min Sketch](#count-min-sketch)。为避免此问题,请设置 `tidb_analyze_version = 2` 并对所有对象重新运行 `ANALYZE`。
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.

Suggested change
迁移的一个主要原因是,版本 1 可能对等值/IN 谓词产生不准确的估算,因为 Count-Min sketch 可能存在哈希冲突。更多信息,请参阅 [Count-Min Sketch](#count-min-sketch)。为避免此问题,请设置 `tidb_analyze_version = 2` 并对所有对象重新运行 `ANALYZE`
迁移的一个主要原因是,版本 1 可能对等值/IN 谓词产生不准确的估算,因为 Count-Min Sketch 可能存在哈希冲突。更多信息,请参阅 [Count-Min Sketch](#count-min-sketch)。为避免此问题,请设置 `tidb_analyze_version = 2` 并对所有对象重新运行 `ANALYZE`

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Apr 3, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-04-03 03:32:56.697889629 +0000 UTC m=+495181.903249686: ☑️ agreed by Oreoxmt.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/S Denotes a PR that changes 10-29 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.

3 participants