Created
May 18, 2017 21:24
-
-
Save GraphBear/534f33d0ae25bedb4da4b26a90f24c74 to your computer and use it in GitHub Desktop.
postgres indexes sorted by size
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 AS name, | |
pg_size_pretty(sum(relpages::bigint*current_setting('block_size')::bigint)::bigint) AS size | |
FROM | |
pg_class | |
WHERE | |
reltype=0 | |
GROUP BY | |
relname | |
ORDER BY | |
sum(relpages) | |
DESC LIMIT 20; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment