合 PG中查询表和索引大小的几个函数pg_total_relation_size、pg_relation_size、pg_table_size、pg_indexes_size的区别
Tags: PGPostgreSQL索引大小表大小
SQL
1 2 3 4 | select pg_size_pretty(pg_total_relation_size('test')); select pg_size_pretty(pg_relation_size('test')); select pg_size_pretty(pg_table_size('test')); select pg_size_pretty(pg_indexes_size('test')); |
区别
total_relation_size, index_size, relation_size的关系可以参考: