From 27811772f099914eeab61d107f9d1c65dc03837c Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Fri, 12 Feb 2016 01:23:56 +0100 Subject: [PATCH] Hint SQL sur comment trouver la taille qu'occupent les INDEX --- pg_size_of_indexes.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 pg_size_of_indexes.sql diff --git a/pg_size_of_indexes.sql b/pg_size_of_indexes.sql new file mode 100644 index 0000000..5b9ed44 --- /dev/null +++ b/pg_size_of_indexes.sql @@ -0,0 +1,8 @@ +SELECT nspname || '.' || relname AS "relation", + pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size" + FROM pg_class C + LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) + WHERE nspname NOT IN ('pg_catalog', 'information_schema') + AND C.relkind = 'i' + AND nspname !~ '^pg_toast' + ORDER BY pg_total_relation_size(C.oid) DESC; -- 2.39.2