Last active
November 27, 2015 18:09
-
-
Save alonisser/470b11fdda67e25e764f to your computer and use it in GitHub Desktop.
Finding the postgres connections hog
This file contains 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
#Broken somehow. need to fix | |
SELECT COUNT(*) as datname, datname, datid FROM pg_stat_activity GROUP BY datname; | |
#Works without id | |
SELECT COUNT(*) as datname, datname FROM pg_stat_activity GROUP BY datname; | |
More info: | |
http://chrismiles.info/systemsadmin/databases/articles/viewing-current-postgresql-queries/ | |
https://support.pivotal.io/hc/en-us/articles/201595093-Script-Session-level-information |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment