Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的架构中有一张表没有被自动清空。如果我VACUUM posts;在桌子上运行,真空过程会很好地完成,但 autovacuum 守护进程不会出于某种原因对桌子进行真空吸尘。有没有办法找出原因?这可能是什么原因?
VACUUM posts;
这很好,没什么好担心的。
该表是唯一的中型表(300 万行)。
如果死元组的数量超过autovacuum_vacuum_scale_factor(默认值:0.2)的活动元组,则自动清理将启动,因此如果超过 20% 的表已被删除或更新。
autovacuum_vacuum_scale_factor
这通常很好,我不会改变它。但是如果你出于某种原因想要这样做,你可以这样做:
ALTER TABLE posts SET (autovacuum_vacuum_scale_factor = 0.1);