system variables: add tidb_analyze_version#5824
Conversation
| # Introduction to Statistics | ||
|
|
||
| TiDB uses statistics to decide [which index to choose](/choose-index.md). The `tidb_analyze_version` variable controls the statistics collected by TiDB. Currently, two versions of statistics are supported: `tidb_analyze_version = 1` and `tidb_analyze_version = 2`. In versions before v5.1, the default value of this variable is `1`. In v5.1, the default value of this variable is `2`, which serves as an experimental feature. These two versions include different information in TiDB: | ||
| TiDB uses statistics to decide [which index to choose](/choose-index.md). The `tidb_analyze_version` variable controls the statistics collected by TiDB. Currently, two versions of statistics are supported: `tidb_analyze_version = 1` and `tidb_analyze_version = 2`. In versions before v5.1.0, the default value of this variable is `1`. In v5.1.0, the default value of this variable is `2`, which serves as an experimental feature. These two versions include different information in TiDB: |
There was a problem hiding this comment.
| TiDB uses statistics to decide [which index to choose](/choose-index.md). The `tidb_analyze_version` variable controls the statistics collected by TiDB. Currently, two versions of statistics are supported: `tidb_analyze_version = 1` and `tidb_analyze_version = 2`. In versions before v5.1.0, the default value of this variable is `1`. In v5.1.0, the default value of this variable is `2`, which serves as an experimental feature. These two versions include different information in TiDB: | |
| TiDB uses statistics to decide [which index to choose](/choose-index.md). The `tidb_analyze_version` variable controls the statistics collected by TiDB. Currently, two versions of statistics are supported: `tidb_analyze_version = 1` and `tidb_analyze_version = 2`. In versions before v5.1.0, the default value of this variable is `1`. Starting from v5.1.0, the default value of this variable is `2`, which works as an experimental feature. These two versions include different information in TiDB: |
There was a problem hiding this comment.
As confirmed with @winoros, it is better to use "in v5.1.0", because in later versions (after the feature is GA) the behavior might change.
There was a problem hiding this comment.
Yes, the default value and the upgrading behavior may be changed in the later sprint and minor version. So we might not need the Starting from
There was a problem hiding this comment.
Ok. For 5.2, let's check this variable again and see if any update is needed. I've made a note here: https://docs.google.com/spreadsheets/d/1ZUUyLNdvnNRSQBkwavYdAoVp8Zo7kRhPoZhlIhWwZ4o/edit#gid=526167010
| - Value options: `1` and `2` | ||
| - Default value: `2` | ||
| - Controls how TiDB collects statistics. | ||
| - In versions before v5.1.0, the default value of this variable is `1`. In v5.1.0, the default value of this variable is `2`, which serves as an experimental feature. For detailed introduction, see [Introduction to Statistics](/statistics.md). |
There was a problem hiding this comment.
| - In versions before v5.1.0, the default value of this variable is `1`. In v5.1.0, the default value of this variable is `2`, which serves as an experimental feature. For detailed introduction, see [Introduction to Statistics](/statistics.md). | |
| - In versions before v5.1.0, the default value of this variable is `1`. Starting from v5.1.0, the default value of this variable is `2`, which works as an experimental feature. For detailed introduction, see [Introduction to Statistics](/statistics.md). |
|
@winoros, could we use this experimental feature in the production environment? |
|
@qiancai Yes we could. We suggest the old cluster use the old way since this can reduce the possibility that the plan changed when upgrading. For new cluster, we suggest to use the new one. |
|
@winoros: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. DetailsIn 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 ti-community-infra/tichi repository. |
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
|
/merge |
|
@TomShawn: DetailsIn 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 ti-community-infra/tichi repository. |
|
/remove-status LGT1 |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 3c2443b |
|
In response to a cherrypick label: new pull request created: #5846. |
What is changed, added or deleted? (Required)
Add the variable which is added in #5781.
Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
tidb_analyze_versiondocs-cn#6494Do your changes match any of the following descriptions?