diff --git a/identify-slow-queries.md b/identify-slow-queries.md index fbc44bca02a5..d840d8762b4c 100644 --- a/identify-slow-queries.md +++ b/identify-slow-queries.md @@ -82,6 +82,7 @@ Slow Query 基础信息: * `Backoff_total`:表示这个语句在执行过程中所有 backoff 花费的时间。 * `Write_sql_response_total`:表示这个语句把结果发送回客户端花费的时间。 * `Result_rows`:表示这个语句查询结果的行数。 +* `Warnings`:表示这个语句执行过程中产生的警告,采用 JSON 格式。通常和 [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) 语句的输出结果一致,但是可能会包含 [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) 中没有的警告,因而可以提供更多诊断信息。这类警告将被标记为 `IsExtra: true`。 * `IsExplicitTxn`:表示这个语句是否在一个明确声明的事务中。如果是 `false`,表示这个语句的事务是 `autocommit=1`,即语句执行完成后就自动提交的事务。 和事务执行相关的字段: diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md index d5d545c5b2fc..5f01d9178d1d 100644 --- a/information-schema/information-schema-slow-query.md +++ b/information-schema/information-schema-slow-query.md @@ -78,6 +78,7 @@ DESC slow_query; | Backoff_total | double | YES | | NULL | | | Write_sql_response_total | double | YES | | NULL | | | Result_rows | bigint(22) | YES | | NULL | | +| Warnings | longtext | YES | | NULL | | | Backoff_Detail | varchar(4096) | YES | | NULL | | | Prepared | tinyint(1) | YES | | NULL | | | Succ | tinyint(1) | YES | | NULL | | @@ -92,7 +93,7 @@ DESC slow_query; | Prev_stmt | longtext | YES | | NULL | | | Query | longtext | YES | | NULL | | +-------------------------------+---------------------+------+------+---------+-------+ -73 rows in set (0.000 sec) +74 rows in set (0.001 sec) ``` ## CLUSTER_SLOW_QUERY table @@ -170,6 +171,7 @@ desc cluster_slow_query; | Backoff_total | double | YES | | NULL | | | Write_sql_response_total | double | YES | | NULL | | | Result_rows | bigint(22) | YES | | NULL | | +| Warnings | longtext | YES | | NULL | | | Backoff_Detail | varchar(4096) | YES | | NULL | | | Prepared | tinyint(1) | YES | | NULL | | | Succ | tinyint(1) | YES | | NULL | | @@ -184,7 +186,7 @@ desc cluster_slow_query; | Prev_stmt | longtext | YES | | NULL | | | Query | longtext | YES | | NULL | | +-------------------------------+---------------------+------+------+---------+-------+ -74 rows in set (0.000 sec) +75 rows in set (0.001 sec) ``` 查询集群系统表时,TiDB 也会将相关计算下推给其他节点执行,而不是把所有节点的数据都取回来,可以查看执行计划,如下: