Created
July 31, 2012 19:10
-
-
Save martinciu/3219616 to your computer and use it in GitHub Desktop.
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 c.relname AS Name, | |
pg_size_pretty(pg_relation_size(c.relname::text)) AS Data, | |
pg_size_pretty(pg_total_relation_size(c.relname::text)- | |
pg_relation_size(c.relname::text)) AS Indices, | |
pg_size_pretty(pg_total_relation_size(c.relname::text)) AS Total | |
FROM pg_class c | |
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace | |
WHERE c.relkind IN ('r','') | |
AND n.nspname NOT IN ('pg_catalog', 'pg_toast') | |
AND pg_table_is_visible(c.oid) | |
ORDER BY c.relpages DESC limit 20; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment