February 18, 2019 at 1:23 pm
#16958

Participant
This script will be helpful to show the queries in postgres which is running more than 5 minutes
SELECT pid, now() - query_start as "runtime", usename, datname, state, query FROM pg_stat_activity WHERE now() - query_start > '60'::interval ORDER BY runtime DESC;