statistics: add docs for the FLUSH STATS_DELTA statement#23258
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found 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.
Code Review
This pull request documents the new FLUSH STATS_DELTA SQL statement, which immediately persists pending statistics delta from TiDB memory to the mysql.stats_meta system table. The changes include a new dedicated documentation file, updates to the table of contents, the SQL statements overview, and the statistics guide. The review feedback is highly constructive, focusing on improving clarity, readability, and style guide compliance by replacing passive voice with active voice, using the second person ('you'), and capitalizing list item descriptions.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| # FLUSH STATS_DELTA | ||
|
|
||
| `FLUSH STATS_DELTA` persists the pending statistics delta buffered in TiDB memory to the [`mysql.stats_meta`](/mysql-schema/mysql-schema.md#statistics-system-tables) system table immediately. TiDB supports this statement starting from v8.5.7 and v9.0.0. |
There was a problem hiding this comment.
Maybe the statement v9.0.0 needs a check from doc steam.
|
@winoros: adding LGTM is restricted to approvers and reviewers in OWNERS files. 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 kubernetes-sigs/prow repository. |
|
/hold |
|
@terry1purcell: adding LGTM is restricted to approvers and reviewers in OWNERS files. 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 kubernetes-sigs/prow repository. |
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?