This command only shows the frontend received processlist now.
Syntax
Example
Terminate the process
After using theSHOW PROCESSLIST command to display the running processes, you can terminate them by the KILL command.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use the SHOW PROCESSLIST command to display the current workload of the system. The output of this command consists of id, user, host, database, time, and info.
| Output | Description |
|---|---|
| worker_id | The id of the worker running the process. |
| id | The id of the process. |
| user | The username associated with the process. |
| host | The host to which the client is connected. |
| database | The database if one is selected. |
| time | The elapsed time since the running sql. |
| info | The statement being executed. |
SHOW PROCESSLIST;
SHOW PROCESSLIST;
------RESULT
Worker Id | Id | User | Host | Database | Time | Info
-----------+-----+------+-----------------+----------+--------+-----------------------
2 | 2:0 | root | 127.0.0.1:50447 | dev | 4114ms | SELECT pg_sleep(3600)
3 | 3:1 | root | 127.0.0.1:50457 | dev | 6ms | SHOW PROCESSLIST
3 | 3:0 | root | 127.0.0.1:50453 | dev | 2844ms | SELECT pg_sleep(3600)
(3 rows)
SHOW PROCESSLIST command to display the running processes, you can terminate them by the KILL command.
KILL id;
SHOW PROCESSLIST;
------RESULT
Worker Id | Id | User | Host | Database | Time | Info
-----------+-----+------+-----------------+----------+--------+-----------------------
2 | 2:0 | root | 127.0.0.1:50447 | dev | 4114ms | SELECT pg_sleep(3600)
3 | 3:1 | root | 127.0.0.1:50457 | dev | 6ms | SHOW PROCESSLIST
3 | 3:0 | root | 127.0.0.1:50453 | dev | 2844ms | SELECT pg_sleep(3600)
(3 rows)
KILL '2:0';
------RESULT
KILL
KILL '3:0';
------RESULT
KILL
SHOW PROCESSLIST;
------RESULT
Worker Id | Id | User | Host | Database | Time | Info
-----------+-----+------+-----------------+----------+------+------------------
2 | 2:0 | root | 127.0.0.1:50447 | dev | |
3 | 3:1 | root | 127.0.0.1:50457 | dev | 2ms | SHOW PROCESSLIST
3 | 3:0 | root | 127.0.0.1:50453 | dev | |
(3 rows)
Was this page helpful?