Computes the disk space used by one “fork” of the specified relation. (Note that for most purposes it is more convenient to use the higher-level functions
|
一个表通常具有4个fork,main(第一个,数据本身,包括表和索引), fsm,vm(对所有事务都可见的页面,仅包含冻结元素的页面,查询优化目的,索引没有vm,每个页面2位,第一位表示页面中的所有元素对所有事务可见,用于确认是否可使用Index only scan;第二位,表示页面是否冻结,如果冻结了,anti-wraparound vacuum不需要访问该页面。设置了一定成立,未设置未必不成立,pg_visibility可用来检查实际值),init。
vacuum与否对性能还是有较大的影响,具体可参见postgresql/lightdb vacuum对性能的影响。
参考:
https://habr.com/en/company/postgrespro/blog/469087/