Descobrindo tamanho de tabelas e índices no PostgreSQL
select schemaname as table_schema,relname as table_name, pg_size_pretty(pg_total_relation_size(relid)) as total_size, pg_size_pretty(pg_relation_size(relid)) as data_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, pg_relation_size(relid) desc;
Referências
Listando tamanho de tabelas e indices
https://dataedo.com/kb/query/postgresql/list-of-tables-by-the-size-of-data-and-indexes
Documentação do pg_indexes
https://www.postgresql.org/docs/current/view-pg-indexes.html
Descobrindo espaço consumido - PostgreSQL Tutorial
https://www.postgresqltutorial.com/postgresql-database-indexes-table-size/