Skip to content

Instantly share code, notes, and snippets.

@DevanR
Created May 25, 2018 12:00
Show Gist options
  • Save DevanR/5c37a04004ce60a8fc0ec16f1d3f9fb8 to your computer and use it in GitHub Desktop.
Save DevanR/5c37a04004ce60a8fc0ec16f1d3f9fb8 to your computer and use it in GitHub Desktop.
Check table sizes in database
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