diff --git a/dashboard/dashboard-slow-query.md b/dashboard/dashboard-slow-query.md index f8f1db1363bfa..5c78cf2fa48a3 100644 --- a/dashboard/dashboard-slow-query.md +++ b/dashboard/dashboard-slow-query.md @@ -59,6 +59,10 @@ Click any item in the list to display detailed execution information of the slow ### SQL +> **Note:** +> +> The maximum length of the query recorded in the `Query` column is limited by the [`tidb_stmt_summary_max_sql_length`](/system-variables.md#tidb_stmt_summary_max_sql_length-new-in-v40) system variable. + Click the **Expand** button to view the detailed information of an item. Click the **Copy** button to copy the detailed information to the clipboard. ### Execution plans diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md index 8510aec12ffc5..9678b20f6a25c 100644 --- a/information-schema/information-schema-slow-query.md +++ b/information-schema/information-schema-slow-query.md @@ -106,6 +106,8 @@ The output is as follows: 74 rows in set (0.001 sec) ``` +The maximum statement length of the `Query` column is limited by the [`tidb_stmt_summary_max_sql_length`](/system-variables.md#tidb_stmt_summary_max_sql_length-new-in-v40) system variable. + ## CLUSTER_SLOW_QUERY table The `CLUSTER_SLOW_QUERY` table provides the slow query information of all nodes in the cluster, which is the parsing result of the TiDB slow log files. You can use the `CLUSTER_SLOW_QUERY` table the way you do with `SLOW_QUERY`. The table schema of the `CLUSTER_SLOW_QUERY` table differs from that of the `SLOW_QUERY` table in that an `INSTANCE` column is added to `CLUSTER_SLOW_QUERY`. The `INSTANCE` column represents the TiDB node address of the row information on the slow query. @@ -222,9 +224,9 @@ The output is as follows: | 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 2f606e80e10c3..34a2eb59269f3 100644 --- a/system-variables.md +++ b/system-variables.md @@ -4588,7 +4588,18 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md). - Type: Integer - Default value: `4096` - Range: `[0, 2147483647]` -- This variable is used to control the length of the SQL string in [statement summary tables](/statement-summary-tables.md). + + + +- This variable is used to control the length of the SQL string in [statement summary tables](/statement-summary-tables.md), the [`SLOW_QUERY`](/information-schema/information-schema-slow-query.md) table, and the [TiDB Dashboard](/dashboard/dashboard-intro.md). + + + + + +- This variable is used to control the length of the SQL string in [statement summary tables](/statement-summary-tables.md) and the [`SLOW_QUERY`](/information-schema/information-schema-slow-query.md) table. + + ### tidb_stmt_summary_max_stmt_count New in v4.0