Created
July 30, 2019 14:21
-
-
Save dbonates/aaef6f485fe2a27d1e104d68f3192f48 to your computer and use it in GitHub Desktop.
Volumetria em todos os schema/bancos de dados e tabelas postgresql
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 datname, pg_size_pretty(pg_database_size(datname)) | |
| FROM pg_database; | |
| --Tamanho de todas as tabelas. | |
| SELECT relname as "Table", | |
| pg_size_pretty(pg_total_relation_size(relid)) As "Size", | |
| pg_size_pretty(pg_total_relation_size(relid) - | |
| pg_relation_size(relid)) as "External Size" | |
| FROM pg_catalog.pg_stat_all_tables ORDER BY | |
| pg_total_relation_size(relid) DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment