Created
September 3, 2018 18:55
-
-
Save duuz/69d1acd3f2d6a4e97bc294c0cb02c9a2 to your computer and use it in GitHub Desktop.
Tamanho das tabelas(Disco) no PostgreSQL
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 esquema, tabela, | |
pg_size_pretty(pg_relation_size(esq_tab)) AS tamanho, | |
pg_size_pretty(pg_total_relation_size(esq_tab)) AS tamanho_total | |
FROM (SELECT tablename AS tabela, | |
schemaname AS esquema, | |
schemaname||'.'||tablename AS esq_tab | |
FROM pg_catalog.pg_tables | |
WHERE schemaname NOT | |
IN ('pg_catalog', 'information_schema', 'pg_toast') ) AS x | |
ORDER BY pg_total_relation_size(esq_tab) DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment