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
2 changes: 1 addition & 1 deletion sql-statements/sql-statement-show-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ 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
2 changes: 1 addition & 1 deletion statement-summary-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ select * from employee where id in (...) and salary between ? and ?;
> - 当 SQL digest 被驱逐时,其相关的所有时间段的 summary 数据都会从 `statements_summary` 和 `statements_summary_history` 这两张表中移除。因此,即使一个时间段的 SQL digest 数量没有超过限制,`statements_summary_history` 表中的 SQL digest 数量也可能小于实际的 SQL digest 数量。如果遇到该情况,并且影响了性能,建议调大 `tidb_stmt_summary_max_stmt_count` 的值。
> - 当启用 [`tidb_stmt_summary_enable_persistent`](#持久化-statements-summary) 时,`statements_summary_history` 表中的数据会持久化到磁盘。此时,`tidb_stmt_summary_max_stmt_count` 仅限制 `statements_summary` 表在内存中可存储的 SQL digest 数量;当超出 `tidb_stmt_summary_max_stmt_count` 的限制时,TiDB 仅会从 `statements_summary` 表中驱逐最久未使用的 SQL digest。

- `tidb_stmt_summary_max_sql_length`:字段 `DIGEST_TEXT` 和 `QUERY_SAMPLE_TEXT` 的最大显示长度,默认值是 4096
- `tidb_stmt_summary_max_sql_length`:字段 `DIGEST_TEXT` 和 `QUERY_SAMPLE_TEXT` 的最大显示长度,默认值是 `32768` (32 KiB)
- `tidb_stmt_summary_internal_query`:是否统计 TiDB 的内部 SQL。1 代表统计,0 代表不统计,默认不统计。

statement summary 配置示例如下:
Expand Down
2 changes: 1 addition & 1 deletion system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -5223,7 +5223,7 @@ Query OK, 0 rows affected, 1 warning (0.00 sec)
- 是否持久化到集群:是
- 是否受 Hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value) 控制:否
- 类型:整数型
- 默认值:`4096`
- 默认值:`32768` (32 KiB)`
- 范围:`[0, 2147483647]`
- 单位:字节
- 这个变量用来控制 [Statement Summary Tables](/statement-summary-tables.md) 和 [TiDB Dashboard](/dashboard/dashboard-intro.md) 中显示的 SQL 字符串长度。
Expand Down