查询一个索引大小
1 |
select pg_size_pretty(pg_relation_size('indexname)) |
查看一张表和它的索引总大小
1 |
select pg_size_pretty(pg_total_relation_size('tablename')); |
查看所有schema里索引大小,按从大到小排列
1 |
select indexrelname,pg_size_pretty( pg_relation_size(relid)) |
查看所有schema里表大小,按从大到小排列
1 |
select relname, pg_size_pretty(pg_relation_size(relid)) |
查看数据库大小
1 |
select pg_database.datname,pg_size_pretty(pg_database_size(pg_database.datname)) AS size |
查看表空间大小
1 |
select pg_tablespace_size('tbs_index')/1024/1024 as "SIZE M"; |
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/236320.html