Created
May 15, 2012 17:05
-
-
Save akahn/2703322 to your computer and use it in GitHub Desktop.
Currently running PostgreSQL queries sorted by duration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT datname, procpid, usename, client_addr, current_query, (current_timestamp - query_start) AS duration | |
| FROM pg_stat_activity | |
| WHERE datname = 'your-database' | |
| ORDER BY duration DESC; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From @DBNess, of course.