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 an index creation or a SELECT from a large table. For demo purposes, we use
explain select pg_select(20).
- Web UI
- Slack


- Run the
activitycommand to get a list of currently running sessions in Postgres.
- Web UI
- Slack


- To stop the execution of a long-running query, run the
terminatecommand with the query'sPIDfrom theactivitylist.
- Web UI
- Slack


- Check that the query was stopped. You can run the
activitycommand again or scroll to the query execution message; it should now have theterminating connection due to administrator commandstatus.
- Web UI
- Slack

