SHOW PROCESSLIST

Syntax

SHOW [FULL] PROCESSLIST

Description

SHOW PROCESSLIST shows you which threads are running. You can also get this information from the information_schema.PROCESSLIST table or the mysqladmin processlist command. If you have the PROCESS privilege, you can see all threads. Otherwise, you can see only your own threads (that is, threads associated with the MariaDB account that you are using). If you do not use the FULL keyword, only the first 100 characters of each statement are shown in the Info field.

The columns shown in SHOW PROCESSLIST are:

Name Description
ID The client's process ID.
USER The username associated with the process.
HOST The host the client is connected to.
DB The default database of the process (NULL if no default).
COMMAND The command type. See Thread Command Values.
TIME The amount of time, in seconds, the process has been in its current state. For a replica SQL thread before MariaDB 10.1, this is the time in seconds between the last replicated event's timestamp and the replica machine's real time.
STATE See Thread States.
INFO The statement being executed.
PROGRESS The total progress of the process (0-100%) (see Progress Reporting).

See TIME_MS column in information_schema.PROCESSLIST for differences in the TIME column between MariaDB and MySQL.

The information_schema.PROCESSLIST table contains the following additional columns:

Name Description
TIME_MS The amount of time, in milliseconds, the process has been in its current state.
STAGE The stage the process is currently in.
MAX_STAGE The maximum number of stages.
PROGRESS The progress of the process within the current stage (0-100%).
MEMORY_USED The amount of memory used by the process.
EXAMINED_ROWS The number of rows the process has examined.
QUERY_ID Query ID.

Note that the PROGRESS field from the information schema, and the PROGRESS field from SHOW PROCESSLIST display different results. SHOW PROCESSLIST shows the total progress, while the information schema shows the progress for the current stage only.

Threads can be killed using their thread_id, or, since MariaDB 10.0.5, their query_id, with the KILL statement.

Since queries on this table are locking, if the performance_schema is enabled, you may want to query the THREADS table instead.

Examples

SHOW PROCESSLIST;
+----+-----------------+-----------+------+---------+------+------------------------+------------------+----------+
| Id | User            | Host      | db   | Command | Time | State                  | Info             | Progress |
+----+-----------------+-----------+------+---------+------+------------------------+------------------+----------+
|  2 | event_scheduler | localhost | NULL | Daemon  | 2693 | Waiting on empty queue | NULL             |    0.000 |
|  4 | root            | localhost | NULL | Query   |    0 | Table lock             | SHOW PROCESSLIST |    0.000 |
+----+-----------------+-----------+------+---------+------+------------------------+------------------+----------+
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

© 2021 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/show-processlist/