diff --git a/information-schema/information-schema-processlist.md b/information-schema/information-schema-processlist.md index 90f6a7706f1e..29c2e136a71b 100644 --- a/information-schema/information-schema-processlist.md +++ b/information-schema/information-schema-processlist.md @@ -17,6 +17,8 @@ aliases: ['/docs-cn/dev/information-schema/information-schema-processlist/'] * `RESOURCE_GROUP` 列:显示对应的资源组名称。 * `SESSION_ALIAS` 列:显示当前连接的别名。 * `ROWS_AFFECTED` 列:显示语句当前影响的行数。 +* `TIDB_CPU` 列:显示语句当前占用 TiDB 服务器 CPU 的时间,单位是纳秒。该列仅在开启 [Top SQL 特性](/dashboard/top-sql.md)时显示实际值,否则始终显示为 `0`。 +* `TIKV_CPU` 列:显示语句当前占用 TiKV 服务器 CPU 的时间,单位是纳秒。 ```sql USE information_schema; @@ -42,6 +44,8 @@ DESC processlist; | RESOURCE_GROUP | varchar(32) | NO | | | | | SESSION_ALIAS | varchar(64) | NO | | | | | ROWS_AFFECTED | bigint(21) unsigned | YES | | NULL | | +| TIDB_CPU | bigint(21) | NO | | 0 | | +| TIKV_CPU | bigint(21) | NO | | 0 | | +----------------+---------------------+------+------+---------+-------+ ``` @@ -66,6 +70,8 @@ SELECT * FROM information_schema.processlist\G RESOURCE_GROUP: default SESSION_ALIAS: ROWS_AFFECTED: 0 + TIDB_CPU: 0 + TIKV_CPU: 0 ``` `PROCESSLIST` 表各列的含义如下: @@ -85,6 +91,8 @@ RESOURCE_GROUP: default * `RESOURCE_GROUP` 列:显示对应的资源组名称。 * `SESSION_ALIAS` 列:显示当前连接的别名。 * `ROWS_AFFECTED` 列:显示语句当前影响的行数。 +* `TIDB_CPU` 列:显示语句当前占用 TiDB 服务器 CPU 的时间,单位是纳秒。该列仅在开启 [Top SQL 特性](/dashboard/top-sql.md)时显示实际值,否则始终显示为 `0`。 +* `TIKV_CPU` 列:显示语句当前占用 TiKV 服务器 CPU 的时间,单位是纳秒。 ## CLUSTER_PROCESSLIST @@ -97,9 +105,9 @@ SELECT * FROM information_schema.cluster_processlist; ``` ```sql -+-----------------+------------+------+-----------------+------+---------+------+------------+------------------------------------------------------+------------------------------------------------------------------+------+------+----------------------------------------+----------------+---------------+---------------+ -| INSTANCE | ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO | DIGEST | MEM | DISK | TxnStart | RESOURCE_GROUP | SESSION_ALIAS | ROWS_AFFECTED | -+-----------------+------------+------+-----------------+------+---------+------+------------+------------------------------------------------------+------------------------------------------------------------------+------+------+----------------------------------------+----------------+---------------+---------------+ -| 127.0.0.1:10080 | 1268776964 | root | 127.0.0.1:59922 | NULL | Query | 0 | autocommit | SELECT * FROM information_schema.cluster_processlist | b1e38e59fbbc3e2b35546db5c8053040db989a497ac6cd71ff8dd4394395701a | 0 | 0 | 07-29 12:39:24.282(451471727468740609) | default | | 0 | -+-----------------+------------+------+-----------------+------+---------+------+------------+------------------------------------------------------+------------------------------------------------------------------+------+------+----------------------------------------+----------------+---------------+---------------+ ++-----------------+------------+------+-----------------+------+---------+------+------------+------------------------------------------------------+------------------------------------------------------------------+------+------+----------------------------------------+----------------+---------------+---------------+----------+----------+ +| INSTANCE | ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO | DIGEST | MEM | DISK | TxnStart | RESOURCE_GROUP | SESSION_ALIAS | ROWS_AFFECTED | TIDB_CPU | TIKV_CPU | ++-----------------+------------+------+-----------------+------+---------+------+------------+------------------------------------------------------+------------------------------------------------------------------+------+------+----------------------------------------+----------------+---------------+---------------+----------+----------+ +| 127.0.0.1:10080 | 1268776964 | root | 127.0.0.1:59922 | NULL | Query | 0 | autocommit | SELECT * FROM information_schema.cluster_processlist | b1e38e59fbbc3e2b35546db5c8053040db989a497ac6cd71ff8dd4394395701a | 0 | 0 | 07-29 12:39:24.282(451471727468740609) | default | | 0 | 0 | 0 | ++-----------------+------------+------+-----------------+------+---------+------+------------+------------------------------------------------------+------------------------------------------------------------------+------+------+----------------------------------------+----------------+---------------+---------------+----------+----------+ ``` diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md index 009bc347284a..663bb307f2ea 100644 --- a/information-schema/information-schema-slow-query.md +++ b/information-schema/information-schema-slow-query.md @@ -92,6 +92,8 @@ DESC slow_query; | Request_unit_read | double | YES | | NULL | | | Request_unit_write | double | YES | | NULL | | | Time_queued_by_rc | double | YES | | NULL | | +| Tidb_cpu_time | double | YES | | NULL | | +| Tikv_cpu_time | double | YES | | NULL | | | Plan | longtext | YES | | NULL | | | Plan_digest | varchar(128) | YES | | NULL | | | Binary_plan | longtext | YES | | NULL | | @@ -190,6 +192,8 @@ DESC CLUSTER_SLOW_QUERY; | Request_unit_read | double | YES | | NULL | | | Request_unit_write | double | YES | | NULL | | | Time_queued_by_rc | double | YES | | NULL | | +| Tidb_cpu_time | double | YES | | NULL | | +| Tikv_cpu_time | double | YES | | NULL | | | Plan | longtext | YES | | NULL | | | Plan_digest | varchar(128) | YES | | NULL | | | Binary_plan | longtext | YES | | NULL | |