-
Notifications
You must be signed in to change notification settings - Fork 1.2k
tidb: document analyze v1 removal #21599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
qiancai
wants to merge
6
commits into
pingcap:master
Choose a base branch
from
qiancai:poe-patch-analyze-v1-master-docs-22655
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1768a68
Auto-sync: Update Chinese docs from English PR
github-actions[bot] 53b5e97
Apply suggestions from code review
qiancai e2edf6c
clean format
qiancai de21168
Update system-variables.md
qiancai 4bfa0bd
Apply suggestions from code review
qiancai 0981eab
Apply suggestions from code review
qiancai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,7 +21,7 @@ aliases: ['/docs-cn/dev/sql-statements/sql-statement-show-analyze-status/'] | |||||
| | `Table_schema` | 数据库名 | | ||||||
| | `Table_name` | 表名 | | ||||||
| | `Partition_name` | 分区名 | | ||||||
| | `Job_info` | 任务具体信息。当收集索引的统计信息时,该信息会包含索引名。当 `tidb_analyze_version = 2` 时,该信息会包含采样率等配置项。 | | ||||||
| | `Job_info` | `ANALYZE` 子任务的简要描述。该描述包含 `ANALYZE` 的作用域(例如列、索引或全局统计信息合并),并可能包含实际生效的选项,例如 `buckets`、`topn`、`samplerate` 或 `samples`。 | ||||||
|
qiancai marked this conversation as resolved.
|
||||||
| | `Processed_rows` | 已经 `ANALYZE` 的行数 | | ||||||
| | `Start_time` | 任务开始执行的时间 | | ||||||
| | `End_time` | 任务结束执行的时间 | | ||||||
|
|
@@ -40,31 +40,14 @@ ShowLikeOrWhereOpt ::= 'LIKE' SimpleExpr | 'WHERE' Expression | |||||
|
|
||||||
| ## 示例 | ||||||
|
|
||||||
| > **注意:** | ||||||
| > | ||||||
| > 从 v9.0.0 起,TiDB 不再支持使用统计信息版本 1(`tidb_analyze_version = 1`)收集新的统计信息。以下示例展示了统计信息版本 2 下当前的 `ANALYZE` 行为。 | ||||||
|
qiancai marked this conversation as resolved.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```sql | ||||||
| mysql> create table t(x int, index idx(x)) partition by hash(x) partitions 2; | ||||||
| Query OK, 0 rows affected (0.69 sec) | ||||||
|
|
||||||
| mysql> set @@tidb_analyze_version = 1; | ||||||
| Query OK, 0 rows affected (0.00 sec) | ||||||
|
|
||||||
| mysql> analyze table t; | ||||||
| Query OK, 0 rows affected (0.20 sec) | ||||||
|
|
||||||
| mysql> show analyze status; | ||||||
| +--------------+------------+----------------+-------------------+----------------+---------------------+---------------------+----------+-------------+----------------+------------+------------------+----------+---------------------+ | ||||||
| | Table_schema | Table_name | Partition_name | Job_info | Processed_rows | Start_time | End_time | State | Fail_reason | Instance | Process_ID | Remaining_seconds| Progress | Estimated_total_rows| | ||||||
| +--------------+------------+----------------+-------------------+----------------+---------------------+---------------------+----------+-------------+----------------+------------+------------------+----------+---------------------+ | ||||||
| | test | t | p1 | analyze index idx | 0 | 2022-05-27 11:29:46 | 2022-05-27 11:29:46 | finished | NULL | 127.0.0.1:4000 | NULL | NULL | NULL | NULL | | ||||||
| | test | t | p0 | analyze index idx | 0 | 2022-05-27 11:29:46 | 2022-05-27 11:29:46 | finished | NULL | 127.0.0.1:4000 | NULL | NULL | NULL | NULL | | ||||||
| | test | t | p1 | analyze columns | 0 | 2022-05-27 11:29:46 | 2022-05-27 11:29:46 | finished | NULL | 127.0.0.1:4000 | NULL | NULL | NULL | NULL | | ||||||
| | test | t | p0 | analyze columns | 0 | 2022-05-27 11:29:46 | 2022-05-27 11:29:46 | finished | NULL | 127.0.0.1:4000 | NULL | NULL | NULL | NULL | | ||||||
| | test | t1 | p0 | analyze columns | 28523259 | 2022-05-27 11:29:46 | 2022-05-27 11:29:46 | running | NULL | 127.0.0.1:4000 | 690208308 | 0s | 0.9843 | 28978290 | | ||||||
| +--------------+------------+----------------+-------------------+----------------+---------------------+---------------------+----------+-------------+----------------+------------+------------------+----------+---------------------+ | ||||||
| 4 rows in set (0.01 sec) | ||||||
|
|
||||||
| mysql> set @@tidb_analyze_version = 2; | ||||||
| Query OK, 0 rows affected (0.00 sec) | ||||||
|
|
||||||
| mysql> analyze table t; | ||||||
| Query OK, 0 rows affected, 2 warnings (0.03 sec) | ||||||
|
|
||||||
|
|
@@ -74,12 +57,8 @@ mysql> show analyze status; | |||||
| +--------------+------------+----------------+--------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+----------------+------------+--------------------+----------+----------------------+ | ||||||
|
qiancai marked this conversation as resolved.
|
||||||
| | test | t | p1 | analyze table all columns with 256 buckets, 500 topn, 1 samplerate | 0 | 2022-05-27 11:30:12 | 2022-05-27 11:30:12 | finished | NULL | 127.0.0.1:4000 | NULL | NULL | NULL | NULL | | ||||||
|
qiancai marked this conversation as resolved.
|
||||||
| | test | t | p0 | analyze table all columns with 256 buckets, 500 topn, 1 samplerate | 0 | 2022-05-27 11:30:12 | 2022-05-27 11:30:12 | finished | NULL | 127.0.0.1:4000 | NULL | NULL | NULL | NULL | | ||||||
|
qiancai marked this conversation as resolved.
|
||||||
| | test | t | p1 | analyze index idx | 0 | 2022-05-27 11:29:46 | 2022-05-27 11:29:46 | finished | NULL | 127.0.0.1:4000 | NULL | NULL | NULL | NULL | | ||||||
| | test | t | p0 | analyze index idx | 0 | 2022-05-27 11:29:46 | 2022-05-27 11:29:46 | finished | NULL | 127.0.0.1:4000 | NULL | NULL | NULL | NULL | | ||||||
| | test | t | p1 | analyze columns | 0 | 2022-05-27 11:29:46 | 2022-05-27 11:29:46 | finished | NULL | 127.0.0.1:4000 | NULL | NULL | NULL | NULL | | ||||||
| | test | t | p0 | analyze columns | 0 | 2022-05-27 11:29:46 | 2022-05-27 11:29:46 | finished | NULL | 127.0.0.1:4000 | NULL | NULL | NULL | NULL | | ||||||
| +--------------+------------+----------------+--------------------------------------------------------------------+----------------+---------------------+---------------------+----------+-------------+----------------+------------+--------------------+----------+----------------------+ | ||||||
|
qiancai marked this conversation as resolved.
|
||||||
| 6 rows in set (0.00 sec) | ||||||
| 2 rows in set (0.00 sec) | ||||||
|
qiancai marked this conversation as resolved.
|
||||||
| ``` | ||||||
|
|
||||||
| ## MySQL 兼容性 | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.