Skip to content

Commit f07c151

Browse files
committed
Update default value for tidb_stmt_summary_max_sql_length
Changed the default value of tidb_stmt_summary_max_sql_length from 4096 to 32768 in documentation files to reflect the new limit for SQL string display length in statement summary tables and related features.
1 parent 4d14f70 commit f07c151

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

sql-statements/sql-statement-show-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ SHOW GLOBAL VARIABLES LIKE 'tidb%';
129129
| tidb_snapshot | |
130130
| tidb_stmt_summary_history_size | 24 |
131131
| tidb_stmt_summary_internal_query | 0 |
132-
| tidb_stmt_summary_max_sql_length | 4096 |
132+
| tidb_stmt_summary_max_sql_length | 32768 |
133133
| tidb_stmt_summary_max_stmt_count | 3000 |
134134
| tidb_stmt_summary_refresh_interval | 1800 |
135135
| tidb_store_limit | 0 |

statement-summary-tables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ select * from employee where id in (...) and salary between ? and ?;
122122
> - 当 SQL digest 被驱逐时,其相关的所有时间段的 summary 数据都会从 `statements_summary``statements_summary_history` 这两张表中移除。因此,即使一个时间段的 SQL digest 数量没有超过限制,`statements_summary_history` 表中的 SQL digest 数量也可能小于实际的 SQL digest 数量。如果遇到该情况,并且影响了性能,建议调大 `tidb_stmt_summary_max_stmt_count` 的值。
123123
> - 当启用 [`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。
124124
125-
- `tidb_stmt_summary_max_sql_length`:字段 `DIGEST_TEXT``QUERY_SAMPLE_TEXT` 的最大显示长度,默认值是 4096
125+
- `tidb_stmt_summary_max_sql_length`:字段 `DIGEST_TEXT``QUERY_SAMPLE_TEXT` 的最大显示长度,默认值是 `32768` (32 KiB)
126126
- `tidb_stmt_summary_internal_query`:是否统计 TiDB 的内部 SQL。1 代表统计,0 代表不统计,默认不统计。
127127

128128
statement summary 配置示例如下:

system-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5223,7 +5223,7 @@ Query OK, 0 rows affected, 1 warning (0.00 sec)
52235223
- 是否持久化到集群:是
52245224
- 是否受 Hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value) 控制:否
52255225
- 类型:整数型
5226-
- 默认值:`4096`
5226+
- 默认值:`32768` (32 KiB)`
52275227
- 范围:`[0, 2147483647]`
52285228
- 单位:字节
52295229
- 这个变量用来控制 [Statement Summary Tables](/statement-summary-tables.md) 和 [TiDB Dashboard](/dashboard/dashboard-intro.md) 中显示的 SQL 字符串长度。

0 commit comments

Comments
 (0)