Last active
January 5, 2016 23:46
-
-
Save JoshuaGross/6d7f74946e32b6710e70 to your computer and use it in GitHub Desktop.
Size of all relations (indices, tables, etc) in a Postgres DB.
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 | |
relname AS objectname, | |
relkind AS objecttype, | |
reltuples AS "#entries", | |
pg_size_pretty(relpages::bigint*8*1024) AS size | |
FROM pg_class | |
WHERE relpages >= 8 | |
ORDER BY relpages DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment