Note
This view is available starting with V1.4.
Purpose
This view provides information about running threads.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| ID | bigint(20) unsigned | NO | The connection identifier. |
| USER | varchar(32) | NO | The username. |
| HOST | varchar(128) | NO | The name of the client host. |
| DB | varchar(128) | YES | The name of the database. |
| COMMAND | varchar(4096) | NO | The type of command executed by the thread. |
| TIME | bigint(20) | NO | The duration of the thread in the current state, in seconds. |
| STATE | varchar(128) | YES | The identifier of the task being performed by the thread. |
| INFO | varchar(262143) | YES | The statement being executed by the current thread. |
Sample query
Query the information about all running threads in a user tenant.
obclient [oceanbase]> SELECT * FROM information_schema.PROCESSLIST;
The query result is as follows:
+------------+------+----------------------+-----------+---------+------+--------+----------------------------------------------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+------------+------+----------------------+-----------+---------+------+--------+----------------------------------------------+
| 3221741020 | root | 100.xx.xxx.xxx:13803 | NULL | Sleep | 864 | SLEEP | NULL |
| 3221633480 | SYS | 100.xx.xxx.xxx:59160 | SYS | Sleep | 1150 | SLEEP | NULL |
| 3221660128 | root | 100.xx.xxx.xxx:44492 | oceanbase | Sleep | 55 | SLEEP | NULL |
| 3221688871 | root | 100.xx.xxx.xxx:49218 | infotest | Query | 0 | ACTIVE | SELECT * FROM information_schema.PROCESSLIST |
+------------+------+----------------------+-----------+---------+------+--------+----------------------------------------------+
4 rows in set