PostgreSQL 13: Tuning Autovacuum for Insert-Only Tables
For tables that only receive inserts—no updates or deletes—space reclamation isn't a concern. The real issue is preventing “anti-wraparound” vacuums, which PostgreSQL forces to avoid transaction ID wraparound. On very large static tables, you can push these forced autovacuums further apart by adjusting autovacuum_freeze_max_age or vacuum_freeze_min_age.
Consider setting autovacuum_freeze_max_age per-table when you want to minimize interruptions:
ALTER TABLE mytable SET (
autovacuum_freeze_max_age = 100000
);
The PostgreSQL 13 documentation on routine vacuuming explains this trade-off. There's no single “better” choice between increasing autovacuum_freeze_max_age versus decreasing vacuum_freeze_min_age—it depends on your workload and table size. Both approaches extend the interval, but they affect how aggressively tuples are marked frozen during vacuum, so you'll want to test which works best for your specific insert-only tables.



