From ec3a842a1848322e6ac07dab170aa106981e3f6c Mon Sep 17 00:00:00 2001 From: Ivan Vakhrushev Date: Sat, 27 Apr 2024 22:36:17 +0400 Subject: [PATCH] Add index_size to the query results --- sql/indexes_with_boolean.sql | 1 + sql/indexes_with_null_values.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/indexes_with_boolean.sql b/sql/indexes_with_boolean.sql index 2dcbfc9..2f73b9f 100644 --- a/sql/indexes_with_boolean.sql +++ b/sql/indexes_with_boolean.sql @@ -9,6 +9,7 @@ select pi.indrelid::regclass::text as table_name, pi.indexrelid::regclass::text as index_name, + pg_relation_size(pi.indexrelid) as index_size, col.attname as column_name, col.attnotnull as column_not_null from diff --git a/sql/indexes_with_null_values.sql b/sql/indexes_with_null_values.sql index 6ec2022..473a07e 100644 --- a/sql/indexes_with_null_values.sql +++ b/sql/indexes_with_null_values.sql @@ -9,7 +9,7 @@ select x.indrelid::regclass as table_name, x.indexrelid::regclass as index_name, - string_agg(a.attname, ', ') as nullable_fields, + string_agg(a.attname, ', ') as nullable_fields, -- In fact, there will always be only one column. pg_relation_size(x.indexrelid) as index_size from pg_catalog.pg_index x