|||
参考用pg_table_size(regclass)函数:
select tablename,
pg_size_pretty(pg_table_size( (quote_ident(schemaname) || '.' || quote_ident(tablename))::regclass ))
from pg_tables
order by tablename;
也可以:
select relname, pg_size_pretty(pg_table_size(oid)) from pg_class
where relkind = 'r'
order by relname;
或者:
SELECT RELNAME ,pg_relation_size(RELNAME::regclass ) FROM PG_STAT_USER_TABLES ;
relname | pg_relation_size
---------+------------------
foo | 217489408
(1 row)
请自行参考,写你自己的sql语句。
加我私人微信,交流技术。
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-25 16:39
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社