You can use the SHOW PROCESSLIST syntax to query the SQL statements that are being executed in LindormTable and LindormTSDB and the details of the statements. You can use this syntax to identify slow and invalid queries.
Applicable engines and versions
The SHOW PROCESSLIST syntax is applicable to LindormTable and LindormTSDB.
The SHOW PROCESSLIST syntax is supported by LindormTable 2.6.2 and later versions.
The SHOW PROCESSLIST syntax is supported by all versions of LindormTSDB.
The version of Lindorm SQL must be 2.6.3.2 or later. For more information about how to view the Lindorm SQL version, see SQL versions.
Syntax
show_processlist_statement ::= SHOW PROCESSLISTReturned results
The results returned by SHOW PROCESSLIST vary with the Lindorm engine.
The following table describes the results that are returned by SHOW PROCESSLIST for LindormTable.
Field | Data type | Description |
ID | VARCHAR | The ID of the query statement that is being executed. To terminate a SQL statement that is being executed, execute the following statement: |
USER | VARCHAR | The user who submits the SQL statement for execution. |
HOST | VARCHAR | The IP address of the client that initiated the query. |
DB | VARCHAR | The database that stores the data queried by the SQL statement. |
CREATED | VARCHAR | The time when the SQL statement is created. |
COMMAND | VARCHAR | The statement executed for the query. |
TIME | VARCHAR | The time elapsed from the start of the query to the current time. Unit: millisecond. |
RAW ID | VARCHAR | The raw ID of the subtask that is split from the query task by LindormTable. The raw ID can be provided by the technical support of Lindorm for troubleshooting. |
EXECUTE START | VARCHAR | The start time of the query. The value of this field is a UNIX timestamp that indicates the number of seconds that have elapsed since 00:00:00 January 1, 1970. |
EXECUTE SERVER | VARCHAR | The server on which the query is performed. |
The following table describes the results that are returned by SHOW PROCESSLIST for LindormTSDB.
Field | Data type | Description |
ID | VARCHAR | The ID of the SQL statement that is being executed. To terminate a SQL statement that is being executed, execute the following statement: |
USER | VARCHAR | The user who submits the SQL statement for execution. |
HOST | VARCHAR | The server on which the SQL statement is being executed. |
DB | VARCHAR | The database that stores the data queried by the SQL statement. |
TYPE | VARCHAR | The type of the SQL statement. Example: SELECT and CREATE. |
CREATED | VARCHAR | The time when the SQL statement is created. |
SQL | VARCHAR | The SQL statement that is being executed. |
Example
Query the SQL statements that are being executed and their detailed information.
SHOW PROCESSLIST;The following result is returned:
+-------------------------------------------------+------+----------+------+---------+-------------------------------+--------------------------------+
| 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` |
+-------------------------------------------------+------+----------+------+---------+-------------------------------+--------------------------------+