Skip to content

Instantly share code, notes, and snippets.

@rdemorais
Created June 15, 2019 13:29
Show Gist options
  • Save rdemorais/1e1a08f9b7ed884ea15e7ea700398ec9 to your computer and use it in GitHub Desktop.
Save rdemorais/1e1a08f9b7ed884ea15e7ea700398ec9 to your computer and use it in GitHub Desktop.
Tamanho das tabelas - Postgres
SELECT
schemaname,
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_statio_user_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