From abaffdfffe3aa6d06def4aa679c6c00ebed3e31c Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Mon, 22 Jan 2024 11:51:21 +0800 Subject: [PATCH] Add/clarify SQL length limits (#16172) (#16227) --- dashboard/dashboard-slow-query.md | 4 ++++ information-schema/information-schema-slow-query.md | 6 +++--- system-variables.md | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dashboard/dashboard-slow-query.md b/dashboard/dashboard-slow-query.md index 0c424eb2e08a..2a670667235c 100644 --- a/dashboard/dashboard-slow-query.md +++ b/dashboard/dashboard-slow-query.md @@ -59,6 +59,10 @@ summary: 了解如何在 TiDB Dashboard 中查看慢查询。 ### SQL +>**注意:** +> +> 记录在 `Query` 中的查询的长度会受到 [`tidb_stmt_summary_max_sql_length`](/system-variables.md#tidb_stmt_summary_max_sql_length-从-v40-版本开始引入) 系统变量的限制。 + 点击**展开** (**Expand**) 可以展开相应项的完整内容,点击**复制** (**Copy**) 可以复制内容到剪贴板。 ### 执行计划 diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md index 67b9fc500df8..b29cdce83c10 100644 --- a/information-schema/information-schema-slow-query.md +++ b/information-schema/information-schema-slow-query.md @@ -202,9 +202,9 @@ DESC SELECT COUNT(*) FROM CLUSTER_SLOW_QUERY WHERE user = 'u1'; | id | estRows | task | access object | operator info | +----------------------------+----------+-----------+--------------------------+------------------------------------------------------+ | StreamAgg_7 | 1.00 | root | | funcs:count(1)->Column#75 | -| └─TableReader_13 | 10.00 | root | | data:Selection_12 | -| └─Selection_12 | 10.00 | cop[tidb] | | eq(INFORMATION_SCHEMA.cluster_slow_query.user, "u1") | -| └─TableFullScan_11 | 10000.00 | cop[tidb] | table:CLUSTER_SLOW_QUERY | keep order:false, stats:pseudo | +| └─TableReader_13 | 10.00 | root | | data:Selection_12 | +| └─Selection_12 | 10.00 | cop[tidb] | | eq(INFORMATION_SCHEMA.cluster_slow_query.user, "u1") | +| └─TableFullScan_11 | 10000.00 | cop[tidb] | table:CLUSTER_SLOW_QUERY | keep order:false, stats:pseudo | +----------------------------+----------+-----------+--------------------------+------------------------------------------------------+ 4 rows in set (0.00 sec) ``` diff --git a/system-variables.md b/system-variables.md index c09f492c9a25..782449523bf8 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3850,7 +3850,7 @@ Query OK, 0 rows affected, 1 warning (0.00 sec) - 类型:整数型 - 默认值:`4096` - 范围:`[0, 2147483647]` -- 这个变量控制 [statement summary tables](/statement-summary-tables.md) 显示的 SQL 字符串长度。 +- 这个变量用来控制 [Statement Summary Tables](/statement-summary-tables.md)、[`SLOW_QUERY`](/information-schema/information-schema-slow-query.md) 表和 [TiDB Dashboard](/dashboard/dashboard-intro.md) 中显示的 SQL 字符串长度。 ### `tidb_stmt_summary_max_stmt_count` 从 v4.0 版本开始引入