SHOW PROCESSLIST queries the SQL statements currently running in LindormTable or LindormTSDB, along with execution details for each statement. Use it to identify slow queries and terminate invalid ones.
Prerequisites
Before running SHOW PROCESSLIST, make sure your environment meets these requirements:
LindormTable version 2.6.2 or later, or any version of LindormTSDB
Lindorm SQL version 2.6.3.2 or later
To check your Lindorm SQL version, see SQL versions.
Syntax
SHOW PROCESSLISTReturned fields
The fields returned by SHOW PROCESSLIST differ between LindormTable and LindormTSDB.
LindormTable
| Field | Data type | Description |
|---|---|---|
| ID | VARCHAR | The ID of the running query. Pass this value to KILL QUERY '<ID>' to terminate the query. |
| USER | VARCHAR | The user who submitted the query. |
| HOST | VARCHAR | The IP address of the client that initiated the query. |
| DB | VARCHAR | The database being queried. |
| CREATED | VARCHAR | The time when the query was created. |
| COMMAND | VARCHAR | The SQL statement being executed. |
| TIME | VARCHAR | The elapsed time since the query started, in milliseconds. |
| RAW ID | VARCHAR | The raw ID of the subtask split from the query by LindormTable. Provide this to Lindorm technical support for troubleshooting. |
| EXECUTE START | VARCHAR | The query start time as a Unix timestamp (seconds elapsed since 1970-01-01 00:00:00). |
| EXECUTE SERVER | VARCHAR | The server on which the query is running. |
LindormTSDB
| Field | Data type | Description |
|---|---|---|
| ID | VARCHAR | The ID of the running query. Pass this value to KILL QUERY '<ID>' to terminate the query. |
| USER | VARCHAR | The user who submitted the query. |
| HOST | VARCHAR | The server on which the query is running. |
| DB | VARCHAR | The database being queried. |
| TYPE | VARCHAR | The type of the SQL statement, such as SELECT or CREATE. |
| CREATED | VARCHAR | The time when the query was created. |
| SQL | VARCHAR | The SQL statement being executed. |
Example
The following example shows how to list all running queries.
SHOW PROCESSLIST;Example output (LindormTSDB):
+-------------------------------------------------+------+----------+------+---------+-------------------------------+--------------------------------+
| ID | USER | HOST | DB | TYPE | CREATED | SQL |
+-------------------------------------------------+------+----------+------+---------+-------------------------------+--------------------------------+
| dHNkYi0x@2a2adf60-89d8-4d16-8417-455189644070@1 | root | dHNkYi0x | null | UNKNOWN | 2022-07-08T16:32:30.767+08:00 | SELECT `time`, `host`, |
| | | | | | | `value` FROM `cpu_user` |
+-------------------------------------------------+------+----------+------+---------+-------------------------------+--------------------------------+