Run SHOW PROCESSLIST to view all active processes in your AnalyticDB for MySQL cluster. Use this statement when diagnosing slow queries, connection overloads, or runaway transactions.
INFORMATION_SCHEMA.PROCESSLIST provides the same process information in a queryable table format. See INFORMATION_SCHEMA.PROCESSLIST for details.
Syntax
SHOW [FULL] PROCESSLISTWithout the FULL keyword, the Info field is truncated to the first 100 characters per record. Use SHOW FULL PROCESSLIST to see the complete SQL text.
Example
SHOW FULL PROCESSLIST;Example output:
+----+-----------+------+-----------------+---------+---------+------+---------+----------------------+
| Id | ProcessId | User | Host | DB | Command | Time | State | Info |
+----+-----------+------+-----------------+---------+---------+------+---------+----------------------+
| 1 | task-001 | root | 192.0.2.1:51234 | mydb | query | 5 | running | SELECT * FROM orders |
| 2 | task-002 | app | 192.0.2.2:51235 | NULL | sleep | 0 | sleep | NULL |
+----+-----------+------+-----------------+---------+---------+------+---------+----------------------+Response parameters
| Parameter | Description |
|---|---|
Id | The process ID. |
ProcessId | The unique task ID. Required when running KILL PROCESS. |
User | The account that initiated the process. |
Host | The hostname of the client, in IP address:port number format. |
DB | The database the process is connected to. |
Command | The statement type for the current connection. Valid values: sleep, query, connect. |
Time | How long the current statement has been running, in seconds. |
State | The execution status of the SQL statement. |
Info | The SQL statement. Truncated to 100 characters unless FULL is specified. |
Permissions
Without the PROCESS privilege, SHOW PROCESSLIST returns only the processes running under your own account. A privileged account of a cluster can grant the PROCESS privilege to a standard account to let it view processes for all accounts in the cluster:
GRANT process ON *.* TO account_name;What's next
To stop a running process, use
KILL PROCESSwith theProcessIdvalue from the output.To query process information using SQL filters, use
INFORMATION_SCHEMA.PROCESSLIST.