Skip to content

system variables: add tidb_analyze_version#5824

Merged
ti-chi-bot merged 1 commit into
pingcap:masterfrom
TomShawn:analy-varias
Jun 24, 2021
Merged

system variables: add tidb_analyze_version#5824
ti-chi-bot merged 1 commit into
pingcap:masterfrom
TomShawn:analy-varias

Conversation

@TomShawn
Copy link
Copy Markdown
Contributor

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)

  • master (the latest development version)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 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

@TomShawn TomShawn added translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. v5.1 This PR/issue applies to TiDB v5.1. needs-cherry-pick-release-5.1 labels Jun 22, 2021
@TomShawn TomShawn requested a review from qiancai June 22, 2021 09:43
@ti-chi-bot ti-chi-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 22, 2021
Comment thread statistics.md
# 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:
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
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:

Copy link
Copy Markdown
Contributor Author

@TomShawn TomShawn Jun 24, 2021

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

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.

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

Comment thread system-variables.md
- 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).
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
- 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).

@qiancai
Copy link
Copy Markdown
Collaborator

qiancai commented Jun 23, 2021

@winoros, could we use this experimental feature in the production environment?

@winoros
Copy link
Copy Markdown
Member

winoros commented Jun 24, 2021

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

@ti-chi-bot
Copy link
Copy Markdown
Member

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

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Copy Markdown
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • qiancai

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 24, 2021
@TomShawn
Copy link
Copy Markdown
Contributor Author

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

@TomShawn: /merge in this pull request requires 2 approval(s).

Details

In response to this:

/merge

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.

@TomShawn
Copy link
Copy Markdown
Contributor Author

/remove-status LGT1
/status LGT2

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 24, 2021
@TomShawn
Copy link
Copy Markdown
Contributor Author

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: 3c2443b

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 24, 2021
@ti-chi-bot ti-chi-bot merged commit 3770696 into pingcap:master Jun 24, 2021
@TomShawn TomShawn deleted the analy-varias branch June 24, 2021 10:43
@ti-chi-bot
Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created: #5846.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. v5.1 This PR/issue applies to TiDB v5.1.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants