Created
May 20, 2019 12:09
-
-
Save aaronwalker/fea50e6ff9d3f171facdb6f846ed3eb1 to your computer and use it in GitHub Desktop.
current postgres activity
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 max(now() - xact_start) AS duration, pid, state, query FROM pg_stat_activity | |
| WHERE state IN ('idle in transaction', 'active') | |
| GROUP BY pid, query, state ORDER BY duration; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment