Skip to content

Commit ddd649d

Browse files
committed
adapt the content for 2603
1 parent 06a8e1a commit ddd649d

3 files changed

Lines changed: 11 additions & 26 deletions

File tree

‎statement-summary-tables.md‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ The following is a sample output of querying `statements_summary`:
8787
>
8888
> - In TiDB, the time unit of fields in statement summary tables is nanosecond (ns), whereas in MySQL the time unit is picosecond (ps).
8989
> - Starting from v7.5.1 and v7.6.0, for clusters with [resource control](/tidb-resource-control-ru-groups.md) enabled, `statements_summary` will be aggregated by resource group, for example, the same statements executed in different resource groups will be collected as different records.
90-
> - For TiDB Self-Managed, starting from v9.0.0, you can use [`tidb_stmt_summary_group_by_user`](/system-variables.md#tidb_stmt_summary_group_by_user) to control whether to aggregate statement summaries by execution user. When this variable is set to `ON`, TiDB aggregates the same SQL digest executed by different users into separate records, and the `SAMPLE_USER` field of each record indicates the user who executed the statement. <CustomContent platform="tidb-cloud" plan="essential,premium">For TiDB Cloud Essential and Premium, `tidb_stmt_summary_group_by_user` is `ON` by default, and it is read-only.</CustomContent>
9190
9291
## `statements_summary_history`
9392

@@ -145,8 +144,6 @@ The following system variables are used to control the statement summary:
145144
146145
- `tidb_stmt_summary_max_sql_length`: Specifies the longest display length of `DIGEST_TEXT` and `QUERY_SAMPLE_TEXT`. The default value is `4096`.
147146
- `tidb_stmt_summary_internal_query`: Determines whether to count the TiDB SQL statements. `1` means to count, and `0` means not to count. The default value is `0`.
148-
- `tidb_stmt_summary_group_by_user`: Determines whether to aggregate statement summaries by execution user. `1` means to aggregate by user, and `0` means not to aggregate by user. The default value is `0` for TiDB Self-Managed and TiDB Cloud Dedicated, and `1` for TiDB Cloud Essential and Premium. After you enable this variable, TiDB aggregates the same SQL digest executed by different users into separate rows, which might increase the number of statement summary records and memory usage. Modifying this variable clears the current in-memory statement summary data.
149-
- `tidb_stmt_summary_persist_evicted`: Determines whether to write statement summary records evicted by LRU to the statement summary log after you enable [statements summary persistence](#persist-statements-summary). `1` means to write, and `0` means not to write. The default value is `0`. After you enable this variable, the log contains JSON records marked with `"evicted": true`, and the log volume increases as LRU evictions become more frequent.
150147

151148
An example of the statement summary configuration is shown as follows:
152149

@@ -267,10 +264,6 @@ After statements summary persistence is enabled, the memory keeps only the curre
267264
268265
</CustomContent>
269266

270-
> **Note:**
271-
>
272-
> For TiDB Self-Managed, starting from v9.0.0, you can enable [`tidb_stmt_summary_persist_evicted`](/system-variables.md#tidb_stmt_summary_persist_evicted) to write records evicted by LRU to the statement summary log. TiDB marks these JSON records with `"evicted": true` so that downstream log consumers can identify them. TiDB does not return these records as query results from `statements_summary_history` or `cluster_statements_summary_history`. <CustomContent platform="tidb-cloud" plan="essential,premium">For TiDB Cloud Essential and Premium, `tidb_stmt_summary_persist_evicted` is read-only.</CustomContent>
273-
274267
## Troubleshooting examples
275268

276269
This section provides two examples to show how to use the statement summary feature to troubleshoot SQL performance issues.

‎system-variable-reference.md‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3955,14 +3955,6 @@ Referenced in:
39553955
- [TiDB Configuration File](/tidb-configuration-file.md)
39563956
- [TiDB 6.6.0 Release Notes](/releases/release-6.6.0.md)
39573957

3958-
### tidb_stmt_summary_group_by_user
3959-
3960-
Referenced in:
3961-
3962-
- [SHOW [GLOBAL|SESSION] VARIABLES](/sql-statements/sql-statement-show-variables.md)
3963-
- [Statement Summary Tables](/statement-summary-tables.md)
3964-
- [System Variables](/system-variables.md#tidb_stmt_summary_group_by_user)
3965-
39663958
### tidb_stmt_summary_history_size
39673959

39683960
Referenced in:
@@ -4007,14 +3999,6 @@ Referenced in:
40073999
- [TiDB 5.0.4 Release Notes](/releases/release-5.0.4.md)
40084000
- [TiDB 4.0.14 Release Notes](/releases/release-4.0.14.md)
40094001

4010-
### tidb_stmt_summary_persist_evicted
4011-
4012-
Referenced in:
4013-
4014-
- [SHOW [GLOBAL|SESSION] VARIABLES](/sql-statements/sql-statement-show-variables.md)
4015-
- [Statement Summary Tables](/statement-summary-tables.md)
4016-
- [System Variables](/system-variables.md#tidb_stmt_summary_persist_evicted)
4017-
40184002
### tidb_stmt_summary_refresh_interval
40194003

40204004
Referenced in:

‎system-variables.md‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6254,7 +6254,9 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md).
62546254
62556255
</CustomContent>
62566256
6257-
### tidb_stmt_summary_group_by_user <span class="version-mark">New in v9.0.0 and CLOUD.202603.1</span> {#tidb_stmt_summary_group_by_user}
6257+
<CustomContent platform="tidb-cloud">
6258+
6259+
### tidb_stmt_summary_group_by_user <span class="version-mark">New in CLOUD.202603.1</span> {#tidb_stmt_summary_group_by_user}
62586260
62596261
> **Note:**
62606262
>
@@ -6265,11 +6267,13 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md).
62656267
- Persists to cluster: Yes
62666268
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
62676269
- Type: Boolean
6268-
- Default value: `OFF` for TiDB Self-Managed and TiDB Cloud Dedicated; `ON` for TiDB Cloud Essential and TiDB Cloud Premium
6270+
- Default value: `ON` for TiDB Cloud Essential and TiDB Cloud Premium
62696271
- This variable controls whether to include the user who executes SQL statements as an aggregation dimension in [statement summary tables](/statement-summary-tables.md). When this variable is set to `OFF`, TiDB aggregates the same SQL digest executed by different users into the same row, and the `SAMPLE_USER` field displays one sampled user. When this variable is set to `ON`, TiDB aggregates the same SQL digest executed by different users into separate rows, and the `SAMPLE_USER` field of each row indicates the user who executed the statement.
62706272
- Modifying this variable clears the current in-memory statement summary data because data before and after the modification is aggregated using different dimensions. This does not affect historical data persisted to disk.
62716273
- After you enable this variable, the number of statement summary records might increase with the number of different execution users for the same SQL digest, which increases memory usage.
62726274
6275+
</CustomContent>
6276+
62736277
### tidb_stmt_summary_history_size <span class="version-mark">New in v4.0</span>
62746278
62756279
> **Note:**
@@ -6345,7 +6349,9 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md).
63456349
63466350
</CustomContent>
63476351
6348-
### tidb_stmt_summary_persist_evicted <span class="version-mark">New in v9.0.0 and CLOUD.202603.1</span> {#tidb_stmt_summary_persist_evicted}
6352+
<CustomContent platform="tidb-cloud">
6353+
6354+
### tidb_stmt_summary_persist_evicted <span class="version-mark">New in CLOUD.202603.1</span> {#tidb_stmt_summary_persist_evicted}
63496355
63506356
> **Note:**
63516357
>
@@ -6361,6 +6367,8 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md).
63616367
- This variable takes effect only when [tidb_stmt_summary_enable_persistent](/system-variables.md#tidb_stmt_summary_enable_persistent-new-in-v660) is enabled. TiDB does not return records marked with `"evicted": true` as query results from `statements_summary_history` or `cluster_statements_summary_history`.
63626368
- After you enable this variable, the log volume increases as LRU evictions become more frequent. TiDB writes evicted records using an asynchronous buffer mechanism. When the buffer queue is full, TiDB might drop new evicted records.
63636369
6370+
</CustomContent>
6371+
63646372
### tidb_stmt_summary_refresh_interval <span class="version-mark">New in v4.0</span>
63656373
63666374
> **Note:**

0 commit comments

Comments
 (0)