Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Finding the postgres connections hog
#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