Created
July 2, 2014 12:09
-
-
Save rahul100885/a222b5085b6896d22f19 to your computer and use it in GitHub Desktop.
Find largest size table ( Disk usage )
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
SELECT relname, PG_SIZE_PRETTY(PG_TOTAL_RELATION_SIZE(relid)) FROM pg_stat_all_tables WHERE schemaname != 'pg_toast' AND relname LIKE 'pg_%' ORDER BY PG_TOTAL_RELATION_SIZE(relid) DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment