Created
July 3, 2014 20:16
-
-
Save willgarcia/4e7e1c1388c097218c02 to your computer and use it in GitHub Desktop.
postgres taille schémas
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 schemaname, pg_size_pretty(t.taille::bigint) AS taille_table,pg_size_pretty(t.taille_index::bigint) AS taille_index, pg_size_pretty(t.taille_totale::bigint) AS taille_totale_table | |
FROM (SELECT schemaname, | |
sum(pg_relation_size(schemaname || '.' || tablename)) AS taille, | |
sum(pg_indexes_size(schemaname || '.' || tablename)) AS taille_index, | |
sum(pg_total_relation_size(schemaname || '.' || tablename)) AS taille_totale | |
FROM pg_tables | |
WHERE schemaname != 'my_schema' | |
GROUP BY schemaname) as t ORDER BY taille_totale DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment