Created
March 12, 2019 19:15
-
-
Save jdvor/3fc4c613ab505df953b8d18b8eb13cca to your computer and use it in GitHub Desktop.
Get list of big objects (tables, indexes) in PostgreSQL database. The list is sorted by size descending.
This file contains hidden or 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 objectname, | |
relkind AS objecttype, | |
reltuples AS "#entries", pg_size_pretty(relpages::bigint*8*1024) AS size | |
FROM pg_class | |
WHERE relpages >= 8 | |
ORDER BY relpages DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment