Skip to content

include storage engines in slow query logs and statements summary #20676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions identify-slow-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ Slow Query 基础信息:
* `Request_unit_write`:执行语句消耗的总写 RU。
* `Time_queued_by_rc`:执行语句过程中等待可用资源的总耗时。

和存储引擎相关的字段:

- `Storage_from_kv`:从 v9.0.0 开始引入,表示该语句是否从 TiKV 读取数据。
- `Storage_from_mpp`:从 v9.0.0 开始引入,表示该语句是否从 TiFlash 读取数据。

## 相关系统变量

* [tidb_slow_log_threshold](/system-variables.md#tidb_slow_log_threshold):设置慢日志的阈值,执行时间超过阈值的 SQL 语句将被记录到慢日志中。默认值是 300 ms。
Expand Down
5 changes: 5 additions & 0 deletions statement-summary-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@ SQL 的基础信息:
- `SUM_UNPACKED_BYTES_SENT_TIFLASH_CROSS_ZONE`:SQL 语句向跨可用区 TiFlash 发送的字节数(包含 TiFlash 节点之间跨可用区发送的字节数)
- `SUM_UNPACKED_BYTES_RECEIVED_TIFLASH_CROSS_ZONE`:SQL 语句从跨可用区 TiFlash 接收的字节数(包含 TiFlash 节点之间跨可用区接收的字节数)

和存储引擎相关的字段:

- `STORAGE_KV`:从 v9.0.0 开始引入,表示该类 SQL 语句上一次执行是否从 TiKV 读取了数据。
- `STORAGE_MPP`:从 v9.0.0 开始引入,表示该类 SQL 语句上一次执行是否从 TiFlash 读取了数据。

### `statements_summary_evicted` 字段介绍

- `BEGIN_TIME`: 记录的开始时间;
Expand Down