查询显示不同的值,如何解决这个问题?
postgres=# SELECT pg_size_pretty( pg_database_size('report') );
pg_size_pretty
----------------
**134 GB**
(1 row)第二个请求:
select table_name, pg_size_pretty( pg_relation_size(quote_ident(table_name)) )
from information_schema.tables
where table_schema = 'public'
order by pg_relation_size(quote_ident(table_name)) desc结果:
"zinc_source_bind" "188 MB"
"zinc_blob_bind" "122 MB"
"zinc_agent_info_ex" "121 MB"
"zinc_blob" "110 MB"
"zinc_main" "86 MB"
"zinc_attribs_bind" "49 MB"
"zinc_not_readed" "47 MB"
"zinc_aggregate_info" "46 MB"
"zinc_gate" "39 MB"
"zinc_source" "2488 kB"如何找出它显示不同结果的原因?
发布于 2021-03-10 14:59:47
pg_relation_size显示表的大小,不包括索引和TOAST表。如果您使用pg_total_relation_size,则差距应该较小。
https://stackoverflow.com/questions/66558561
复制相似问题