Skip to content

Commit

Permalink
plan-replayer, slow-queries: update new diagnostic information in tidb (
Browse files Browse the repository at this point in the history
  • Loading branch information
time-and-fate authored Apr 21, 2023
1 parent df110e1 commit 5691c82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion identify-slow-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ Slow query basics:
* `Txn_start_ts`: The start timestamp and the unique ID of a transaction. You can use this value to search for the transaction-related logs.
* `Is_internal`: Whether a SQL statement is TiDB internal. `true` indicates that a SQL statement is executed internally in TiDB and `false` indicates that a SQL statement is executed by the user.
* `Index_names`: The index names used by the statement.
* `Stats`: The health state of the involved tables. `pseudo` indicates that the state is unhealthy.
* `Stats`: The health state, internal version, total row count, modified row count, and load state of statistics that are used during this query. `pseudo` indicates that the statistics information is unhealthy. If the optimizer attempts to use some statistics that are not fully loaded, the internal state is also printed. For example, the meaning of `t1:439478225786634241[105000;5000][col1:allEvicted][idx1:allEvicted]` can be understood as follows:
- `t1`: statistics on table `t1` are used during query optimization.
- `439478225786634241`: the internal version.
- `105000`: the total row count in the statistics.
- `5000`: the number of rows modified since the last statistics collection.
- `col1:allEvicted`: statistics on the column `col1` are not fully loaded.
- `idx1:allEvicted`: statistics on the index `idx1` are not fully loaded.
* `Succ`: Whether a statement is executed successfully.
* `Backoff_time`: The waiting time before retry when a statement encounters errors that require a retry. The common errors as such include: `lock occurs`, `Region split`, and `tikv server is busy`.
* `Plan`: The execution plan of a statement. Execute the `SELECT tidb_decode_plan('xxx...')` statement to parse the specific execution plan.
Expand Down
1 change: 1 addition & 0 deletions sql-plan-replayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Based on `sql-statement`, TiDB sorts out and exports the following on-site infor
- The table schema in `sql-statement`
- The statistics of the table in `sql-statement`
- The result of `EXPLAIN [ANALYZE] sql-statement`
- Some internal procudures of query optimization

> **Note:**
>
Expand Down

0 comments on commit 5691c82

Please sign in to comment.