Created
May 25, 2018 12:00
-
-
Save DevanR/5c37a04004ce60a8fc0ec16f1d3f9fb8 to your computer and use it in GitHub Desktop.
Check table sizes in database
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 table_name, pg_relation_size(table_name), pg_size_pretty(pg_relation_size(table_name)) | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
ORDER by 2 DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment