diff --git a/identify-slow-queries.md b/identify-slow-queries.md index 849a832f26348..bcfd50e2fa47a 100644 --- a/identify-slow-queries.md +++ b/identify-slow-queries.md @@ -84,6 +84,7 @@ Slow query basics: * `Write_sql_response_total`: The time consumed for sending the results back to the client by this statement. * `Result_rows`: The row count of the query results. * `IsExplicitTxn`: Whether this statement is in an explicit transaction. If the value is `false`, the transaction is `autocommit=1` and the statement is automatically committed after execution. +* `Warnings`: The JSON-formatted warnings that are generated during the execution of this statement. These warnings are generally consistent with the output of the [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) statement, but might include extra warnings that provide more diagnostic information. These extra warnings are marked as `IsExtra: true`. The following fields are related to transaction execution: diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md index a0faa422b318f..69429543aeac9 100644 --- a/information-schema/information-schema-slow-query.md +++ b/information-schema/information-schema-slow-query.md @@ -20,7 +20,7 @@ USE information_schema; DESC slow_query; ``` -``` +```sql +-------------------------------+---------------------+------+------+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------------------------+---------------------+------+------+---------+-------+ @@ -84,6 +84,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 | | @@ -98,7 +99,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 @@ -182,6 +183,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 | | @@ -196,7 +198,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) ``` When the cluster system table is queried, TiDB does not obtain data from all nodes, but pushes down the related calculation to other nodes. The execution plan is as follows: