PostgreSQL表存储页查询
查询表预估占用的页数量
select relname,relpages from pg_class
where relnamespace::regnamespace::text = '模式名'
and relname = '表名';
实际数据页数量
-- 实际占用的数据页
select count(distinct split_part(translate(ctid::text,'()',''),',',1)::int) from 表名;
-- 查询每页上的记录数
select split_part(translate(ctid::text,'()',''),',',1)::int,count(*) from 表名
group by 1 order by 1;