Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sql-statements/sql-statement-show-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'tidb%';
| tidb_snapshot | |
| tidb_stmt_summary_history_size | 24 |
| tidb_stmt_summary_internal_query | 0 |
| tidb_stmt_summary_max_sql_length | 4096 |
| tidb_stmt_summary_max_sql_length | 32768 |
| tidb_stmt_summary_max_stmt_count | 3000 |
| tidb_stmt_summary_refresh_interval | 1800 |
| tidb_store_limit | 0 |
Expand Down Expand Up @@ -173,4 +173,4 @@ The `SHOW [GLOBAL|SESSION] VARIABLES` statement in TiDB is fully compatible with

## See also

* [`SET [GLOBAL|SESSION]`](/sql-statements/sql-statement-set-variable.md)
* [`SET [GLOBAL|SESSION]`](/sql-statements/sql-statement-set-variable.md)
2 changes: 1 addition & 1 deletion statement-summary-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ The following system variables are used to control the statement summary:
> - When a SQL digest is evicted, its related summary data of all time ranges is removed from both the `statements_summary` and `statements_summary_history` tables. As a result, even if the number of SQL digests within a specific time range does not exceed the limit, the number of SQL digests in the `statements_summary_history` table might be less than the actual number of SQL digests. If this situation occurs and affects performance, you are recommended to increase the value of `tidb_stmt_summary_max_stmt_count`.
> - For TiDB Self-Managed, when [`tidb_stmt_summary_enable_persistent`](#persist-statements-summary) is enabled, data in the `statements_summary_history` table is persisted to the disk. In this case, `tidb_stmt_summary_max_stmt_count` only limits the number of SQL digests that the `statements_summary` table can store in memory, and TiDB evicts the least recently used SQL digests only from the `statements_summary` table when `tidb_stmt_summary_max_stmt_count` is exceeded.

- `tidb_stmt_summary_max_sql_length`: Specifies the longest display length of `DIGEST_TEXT` and `QUERY_SAMPLE_TEXT`. The default value is `4096`.
- `tidb_stmt_summary_max_sql_length`: Specifies the longest display length of `DIGEST_TEXT` and `QUERY_SAMPLE_TEXT`. The default value is `32768`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

For better readability and consistency, it's helpful to add the human-readable unit (KiB) next to the byte value. This aligns with the documentation style for other byte-sized variables.

Suggested change
- `tidb_stmt_summary_max_sql_length`: Specifies the longest display length of `DIGEST_TEXT` and `QUERY_SAMPLE_TEXT`. The default value is `32768`.
- `tidb_stmt_summary_max_sql_length`: Specifies the longest display length of `DIGEST_TEXT` and `QUERY_SAMPLE_TEXT`. The default value is `32768` (32 KiB).

- `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`.

An example of the statement summary configuration is shown as follows:
Expand Down
2 changes: 1 addition & 1 deletion system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -6007,7 +6007,7 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md).
- Persists to cluster: Yes
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
- Type: Integer
- Default value: `4096`
- Default value: `32768`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

For better readability and consistency with how other byte-sized variables are documented in this file (e.g., tidb_query_log_max_len), it's helpful to add the human-readable unit (KiB) next to the byte value.

Suggested change
- Default value: `32768`
- Default value: `32768` (32 KiB)

- Range: `[0, 2147483647]`
- Unit: Bytes

Expand Down