-
Notifications
You must be signed in to change notification settings - Fork 1.2k
*: update analyze statement
#3241
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fec128e
resources: update the Figma link (#3230)
CaitinChen c262cb2
*: update `analyze` statement
zimulala 2db9c49
fix ci
ran-huang 5e53382
*: address comments
zimulala 57b6e62
Merge branch 'analyze' of github.com:zimulala/docs-cn into zimuxia/an…
zimulala 725546d
Merge branch 'master' of github.com:pingcap/docs-cn into zimuxia/analyze
zimulala 60149e0
Merge branch 'docs-special-week' of github.com:pingcap/docs-cn into z…
zimulala a94b68d
Merge branch 'pingcap/docs-special-week' into zimuxia/analyze
zimulala 20c24a0
Merge branch 'pingcap/docs-special-week' into zimuxia/analyze
zimulala d268644
Merge branch 'pingcap/docs-special-week' into zimuxia/analyze
zimulala 8ad7aaf
*: address a comment
zimulala e47b11e
Merge branch 'docs-special-week' into analyze
zimulala fcd35a3
Merge branch 'docs-special-week' into analyze
sre-bot 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
|---|---|---|
| @@ -1,16 +1,18 @@ | ||
| --- | ||
| title: ANALYZE TABLE | ||
| summary: TiDB 数据库中 ANALYZE TABLE 的使用概况。 | ||
| title: ANALYZE | ||
| summary: TiDB 数据库中 ANALYZE 的使用概况。 | ||
| category: reference | ||
| aliases: ['/docs-cn/dev/reference/sql/statements/analyze-table/'] | ||
| --- | ||
|
|
||
| # ANALYZE TABLE | ||
| # ANALYZE | ||
|
|
||
| `ANALYZE TABLE` 语句用于更新 TiDB 在表和索引上留下的统计信息。执行大批量更新或导入记录后,或查询执行计划不是最佳时,建议运行 `ANALYZE TABLE`。 | ||
| `ANALYZE` 语句用于更新 TiDB 在表和索引上留下的统计信息。执行大批量更新或导入记录后,或查询执行计划不是最佳时,建议运行 `ANALYZE`。 | ||
|
|
||
| 当 TiDB 逐渐发现这些统计数据与预估不一致时,也会自动更新其统计数据。 | ||
|
|
||
| 目前 TiDB 收集统计信息分为全量收集和增量收集两种方式,分别通过 `ANALYZE TABLE` 和 `ANALYZE INCREMENTAL TABLE` 语句来实现。关于这两种语句的详细使用方式,可参考[统计信息简介](/statistics.md)。 | ||
zz-jason marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## 语法图 | ||
|
|
||
| **AnalyzeTableStmt:** | ||
|
|
@@ -102,7 +104,9 @@ EXPLAIN SELECT * FROM t1 WHERE c1 = 3; | |
|
|
||
| ## MySQL 兼容性 | ||
|
|
||
| `ANALYZE TABLE` 在语法上与 MySQL 类似。但 `ANALYZE TABLE` 在 TiDB 上执行所需时间可能长得多,因为它的内部运行方式不同。 | ||
| * `ANALYZE TABLE` 在语法上与 MySQL 类似。但 `ANALYZE TABLE` 在 TiDB 上的执行时间可能长得多,因为它的内部运行方式不同。 | ||
|
Contributor
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.
|
||
|
|
||
| * 在 MySQL 上不支持 `ANALYZE INCREMENTAL TABLE` 语句,它的使用可参考[增量收集文档](/statistics.md#增量收集)。 | ||
|
Contributor
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.
|
||
|
|
||
| ## 另请参阅 | ||
|
|
||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ANALYZE TABLE语句用于更新表和索引的统计信息。执行大批量更新或导入记录后,或查询执行计划不是最佳时,建议运行ANALYZE TABLE。