Skip to content
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

Update two informtion_schema tables desc #18801

Merged
merged 15 commits into from
Oct 16, 2024
Merged
36 changes: 31 additions & 5 deletions information-schema/information-schema-processlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,33 @@ summary: Learn the `PROCESSLIST` information_schema table.

The `PROCESSLIST` table has additional columns not present in `SHOW PROCESSLIST`:

<CustomContent platform="tidb">

* A `DIGEST` column to show the digest of the SQL statement.
* A `MEM` column to show the memory used by the request that is being processed, in bytes.
* A `DISK` column to show the disk usage in bytes.
* A `TxnStart` column to show the start time of the transaction.
* A `RESOURCE_GROUP` column to show the resource group name.
* A `SESSION_ALIAS` column to show the alias of the current session.
* A `ROWS_AFFECTED` column to show the number of rows currently affected by the statement.
* A `TIDB_CPU` column to show the CPU time (in nanoseconds) consumed by the TiDB server for the statement. This column shows meaningful data only when the [Top SQL](/dashboard/top-sql.md) feature is enabled. Otherwise the value will be `0`.
yibin87 marked this conversation as resolved.
Show resolved Hide resolved
* A `TIKV_CPU` column to show the CPU time (in nanoseconds) consumed by the TiKV server for the statement.
yibin87 marked this conversation as resolved.
Show resolved Hide resolved

</CustomContent>

<CustomContent platform="tidb-cloud">

* A `DIGEST` column to show the digest of the SQL statement.
* A `MEM` column to show the memory used by the request that is being processed, in bytes.
* A `DISK` column to show the disk usage in bytes.
* A `TxnStart` column to show the start time of the transaction.
* A `RESOURCE_GROUP` column to show the resource group name.
* A `SESSION_ALIAS` column to show the alias of the current session.
* A `ROWS_AFFECTED` column to show the number of rows currently affected by the statement.
* A `TIDB_CPU` column to show the CPU time (in nanoseconds) consumed by the TiDB server for the statement. This column shows meaningful data only when the [Top SQL](https://docs.pingcap.com/tidb/stable/top-sql) feature is enabled. Otherwise the value will be `0`.
yibin87 marked this conversation as resolved.
Show resolved Hide resolved
* A `TIKV_CPU` column to show the CPU time (in nanoseconds) consumed by the TiKV server for the statement.
yibin87 marked this conversation as resolved.
Show resolved Hide resolved

</CustomContent>

```sql
USE information_schema;
Expand All @@ -41,6 +61,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 | |
+----------------+---------------------+------+------+---------+-------+
```

Expand All @@ -65,6 +87,8 @@ SELECT * FROM information_schema.processlist\G
RESOURCE_GROUP: default
SESSION_ALIAS:
ROWS_AFFECTED: 0
TIDB_CPU: 0
TIKV_CPU: 0
```

Fields in the `PROCESSLIST` table are described as follows:
Expand All @@ -84,6 +108,8 @@ Fields in the `PROCESSLIST` table are described as follows:
* `RESOURCE_GROUP`: The resource group name.
* `SESSION_ALIAS`: The alias of the current session.
* `ROWS_AFFECTED`: The number of rows currently affected by the statement.
* `TIDB_CPU`: The CPU time (in nanoseconds) consumed by the TiDB server for the statement. This column shows meaningful data only when the [Top SQL](/dashboard/top-sql.md) feature is enabled. Otherwise the value will be `0`.
yibin87 marked this conversation as resolved.
Show resolved Hide resolved
* `TIKV_CPU`: The CPU time (in nanoseconds) consumed by the TiKV server for the statement.
yibin87 marked this conversation as resolved.
Show resolved Hide resolved

## CLUSTER_PROCESSLIST

Expand All @@ -94,9 +120,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 |
+-----------------+------------+------+-----------------+------+---------+------+------------+------------------------------------------------------+------------------------------------------------------------------+------+------+----------------------------------------+----------------+---------------+---------------+----------+----------+
```
4 changes: 4 additions & 0 deletions information-schema/information-schema-slow-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ The output is as follows:
| 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 | |
Expand Down Expand Up @@ -222,6 +224,8 @@ The output is as follows:
| 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 | |
Expand Down
Loading