select
relname 表名称
,pg_size_pretty(pg_relation_size(relid)) 表大小text
,pg_size_pretty(pg_total_relation_size(relid)) 表总大小含索引text
,pg_total_relation_size(relid) 表总大小含索引
,pg_relation_size(relid) 表大小
,pg_indexes_size(relid) 索引大小
,pg_size_pretty(pg_indexes_size(relid)) 索引大小text
from pg_stat_user_tables
where schemaname='public'
order by 表大小 desc;
PostgreSQL 查看数据库,索引,表,表空间大小 https://www.cnblogs.com/mchina/archive/2013/04/19/3028573.html
Postgresql 常用数据库管理SQL https://blog.csdn.net/qq_39609993/article/details/122936784