Skip to main content

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 index creation or select from a big table. For demo purposes, we will 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. If you want to stop the execution of a long-running query, run the terminate command with query's PID from the activity list.

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

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

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