statistics: add docs for the FLUSH STATS_DELTA statement (#21819) - #21874
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough新增 ChangesFLUSH STATS_DELTA 文档
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a522fe99-265d-4139-8498-6720e34bc3d2
📒 Files selected for processing (5)
TOC.mdreleases/release-8.5.7.mdsql-statements/sql-statement-flush-stats-delta.mdsql-statements/sql-statement-overview.mdstatistics.md
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiancai The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
sql-statements/sql-statement-flush-stats-delta.md (1)
71-71:⚠️ Potential issue | 🟡 Minor补充
stats-lease = 0s时的加载行为。当
stats-lease为0s时,TiDB 仍会每隔3s从系统表加载统计信息并更新内存缓存;当前文案没有说明这个例外。官方配置文档明确了该行为。 (docs.pingcap.com)请将 Line 71 替换为以下文本:
此时,TiDB 已将该表的行数变化持久化到 `mysql.stats_meta` 系统表。你可以使用 `SHOW STATS_META` 查看已持久化的值。注意,`SHOW STATS_META` 会从你当前连接的 TiDB 节点内存中读取统计信息。该 TiDB 节点会每隔 [`stats-lease`](/tidb-configuration-file.md#stats-lease) 时间(默认 `3s`)加载已持久化的值;当 `stats-lease` 为 `0s` 时,会以 `3s` 的时间间隔加载。因此,刷新后的值可能会在短暂延迟后才显示在输出中:As per path instructions,
**/*.md文件中的连续行可以安全替换时,必须提供精确的 GitHub 可提交建议。Source: Path instructions
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 27aa6491-a2bb-431a-a3fd-5958458ba44f
📒 Files selected for processing (2)
sql-statements/sql-statement-flush-stats-delta.mdstatistics.md
This is an automated cherry-pick of #21819
What is changed, added or deleted? (Required)
Add documentation for the
FLUSH STATS_DELTAstatement introduced in v8.5.7 and v9.0.0 (pingcap/tidb#65668), which persists the pending statistics delta buffered in TiDB memory to themysql.stats_metasystem table immediately.sql-statements/sql-statement-flush-stats-delta.md(synopsis, options, examples, privileges).TOC.mdandsql-statements/sql-statement-overview.md.statistics.md.All examples and behavior descriptions (target scopes,
CLUSTERbroadcast, privilege requirements, and warnings) are verified against a TiDB v8.5.7 TiUP playground with two TiDB instances.Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
flush stats_deltasyntax for optimizer statistics tidb#65677, planner, executor, parser: implement scoped FLUSH STATS_DELTA tidb#67766, planner, executor, parser: support scoped FLUSH STATS_DELTA tidb#68159Do your changes match any of the following descriptions?
Summary by CodeRabbit
新功能
FLUSH STATS_DELTASQL 语句文档,涵盖语法、适用对象、集群级操作、分区表行为、权限要求及使用示例。文档