Skip to content

statistics: deprecate stats v1 in 8.5 docs#22624

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

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

Conversation

@0xPoe
Copy link
Member

@0xPoe 0xPoe commented Mar 24, 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

@ti-chi-bot
Copy link

ti-chi-bot bot commented Mar 24, 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 lilin90 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 24, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the TiDB 8.5 documentation to formally deprecate Statistics Version 1 (tidb_analyze_version = 1). The changes introduce clear warnings across multiple relevant pages, strongly recommending users to migrate to Statistics Version 2 for improved accuracy and performance. It also refines the migration examples to guide users in transitioning their analyzed objects from Version 1 to Version 2.

Highlights

  • Statistics Version 1 Deprecation: Documented that tidb_analyze_version = 1 is deprecated and will be removed in a future release across multiple documentation pages.
  • Migration Guidance: Updated documentation to recommend using Statistics Version 2 and provided aligned migration query examples for transitioning from Version 1 to Version 2.
  • Documentation Updates: Applied deprecation warnings and recommendations to ANALYZE_STATUS, ANALYZE TABLE, SHOW ANALYZE STATUS, statistics.md, and tidb_analyze_version system variable documentation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively documents the deprecation of Statistics Version 1 across several files. The changes are clear and the updated SQL examples for migration are correct.

My review includes a few minor suggestions to improve the wording for better clarity and directness, aligning with the repository's documentation style guide. Specifically, I've recommended using a more active voice (e.g., 'You should use...' instead of 'It is recommended that you use...') to make the instructions for users more direct. These are minor stylistic improvements to an already solid update.


> **Warning:**
>
> Statistics Version 1 (`tidb_analyze_version = 1`) is deprecated and will be removed in a future release. It is recommended that you use Statistics Version 2 (`tidb_analyze_version = 2`).
Copy link
Contributor

Choose a reason for hiding this comment

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

low

To be more direct and align with the documentation style guide's preference for the second person ('you'), I suggest rephrasing this sentence.

Suggested change
> Statistics Version 1 (`tidb_analyze_version = 1`) is deprecated and will be removed in a future release. It is recommended that you use Statistics Version 2 (`tidb_analyze_version = 2`).
> Statistics Version 1 (`tidb_analyze_version = 1`) is deprecated and will be removed in a future release. You should use Statistics Version 2 (`tidb_analyze_version = 2`).
References
  1. The style guide recommends addressing users directly in the second person ('you') and avoiding passive voice. The suggestion improves directness by changing a passive recommendation to an active one. (link)


> **Warning:**
>
> Statistics Version 1 (`tidb_analyze_version = 1`) is deprecated and will be removed in a future release. It is recommended that you use Statistics Version 2 (`tidb_analyze_version = 2`). For details, see [Introduction to Statistics](/statistics.md#versions-of-statistics).
Copy link
Contributor

Choose a reason for hiding this comment

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

low

To be more direct and align with the documentation style guide's preference for the second person ('you'), I suggest rephrasing this sentence.

Suggested change
> Statistics Version 1 (`tidb_analyze_version = 1`) is deprecated and will be removed in a future release. It is recommended that you use Statistics Version 2 (`tidb_analyze_version = 2`). For details, see [Introduction to Statistics](/statistics.md#versions-of-statistics).
> Statistics Version 1 (`tidb_analyze_version = 1`) is deprecated and will be removed in a future release. You should use Statistics Version 2 (`tidb_analyze_version = 2`). For details, see [Introduction to Statistics](/statistics.md#versions-of-statistics).
References
  1. The style guide recommends addressing users directly in the second person ('you') and avoiding passive voice. The suggestion improves directness by changing a passive recommendation to an active one. (link)

@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 24, 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 24, 2026
Copy link
Member Author

@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.

self-check

@0xPoe 0xPoe requested review from mjonss and qiancai March 24, 2026 10:33
@ti-chi-bot
Copy link

ti-chi-bot bot commented Mar 24, 2026

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

Details

In response to this:

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.

@qiancai qiancai added the translation/doing This PR's assignee is translating this PR. label Mar 25, 2026
@ti-chi-bot ti-chi-bot bot removed the missing-translation-status This PR does not have translation status info. label Mar 25, 2026
@qiancai qiancai self-assigned this Mar 25, 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/doing This PR's assignee is translating this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants