SELECT i.relname "Table Name",indexrelname "Index Name",
pg_size_pretty(pg_total_relation_size(relid)) As "Total Size",
pg_size_pretty(pg_indexes_size(relid)) as "Total Size of all Indexes",
pg_size_pretty(pg_relation_size(relid)) as "Table Size",
pg_size_pretty(pg_relation_size(indexrelid)) "Index Size",
reltuples::bigint "Estimated table row count"
FROM pg_stat_all_indexes i JOIN pg_class c ON i.relid=c.oid
where i.relid ='media.block'::regclass
Table Name|Index Name |Total Size|Total Size of all Indexes|Table Size|Index Size|Estimated table row count|
----------+----------------+----------+-------------------------+----------+----------+-------------------------+
block |block_pkey |352 GB |5584 MB |347 GB |1986 MB | 38958848|
block |uidx_block_hs256|352 GB |5584 MB |347 GB |3226 MB | 38958848|
block |idx_block_unused|352 GB |5584 MB |347 GB |372 MB | 38958848|