select t1.relname as 表名, pg_size_pretty(pg_relation_size(relid)) as 大小, (select cast(reltuples as INTEGER) from pg_class where relkind = 'r' and relname = t1.relname) as 记录数 from pg_stat_user_tables as t1 where schemaname='course' order by pg_relation_size(relid) desc
postgresql 表会随着各种操作产生碎片数据导致表膨胀,可以执行'vacuum full'命令清理。
标签:postgresql,整理表,t1,relname,pg,数据量,size From: https://www.cnblogs.com/jsper/p/17543396.html