How to get a list of active queries in a Joe session and stop long-running queries
- Run a long query, for example, it could be index creation or select from a big table. For demo purposes, we will use
explain select pg_select(20)
.
- Web UI
- Slack
- Run the
activity
command to get a list of currently running sessions in Postgres.
- Web UI
- Slack
- If you want to stop the execution of a long-running query, run the
terminate
command with query'sPID
from theactivity
list.
- Web UI
- Slack
- Check that query was stopped. You can run the
activity
command again or scroll to the query execution message, it should haveterminating connection due to administrator command
status now.
- Web UI
- Slack