docs.jjon.com

PostgreSQL Autovacuum Thresholds Under High-Churn Tables

Why default scale factors lag behind on large append-and-update tables.

Per-Table Overrides

With the default 20% scale factor, a 50M-row table accumulates 10M dead tuples before autovacuum triggers. Lowering the scale factor per table keeps index bloat predictable.

ALTER TABLE job_events SET (
  autovacuum_vacuum_scale_factor = 0.02,
  autovacuum_analyze_scale_factor = 0.01
);