Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions identify-slow-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
8 changes: 5 additions & 3 deletions information-schema/information-schema-slow-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ USE information_schema;
DESC slow_query;
```

```
```sql
+-------------------------------+---------------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------------------+---------------------+------+------+---------+-------+
Expand Down Expand Up @@ -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 | |
Expand All @@ -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
Expand Down Expand Up @@ -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 | |
Expand All @@ -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:
Expand Down