Skip to main content
View rawEdit

How to get a list of active queries in a Joe session and stop long-running queries

  1. 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).

Execute long-running query / Web UI

  1. Run the activity command to get a list of currently running sessions in Postgres.

Activity / Active queries / Web UI

  1. To stop the execution of a long-running query, run the terminate command with the query's PID from the activity list.

Terminate / Stop execution of long-running query / Web UI

  1. Check that the query was stopped. You can run the activity command again or scroll to the query execution message; it should now have the terminating connection due to administrator command status.

Activity / No active queries / Web Query / Failed due to administrator command / Web UI