On Heroku, the pg-extras
CLI Plugin is available.
List currently running queries that have been running for longer than 5 minutes. Heroku dynos have a 30-seconds disconnect so queries still running after 5 mins are usually problematic and can slow down the entire DB.