Autovacuum global tuning
Three autovacuum parameters are recommended together because they are interdependent. Changing one without the others can make vacuuming slower, not faster.
The core problem
autovacuum_vacuum_cost_limit is a total I/O budget that PostgreSQL divides across running workers:
Raising worker count without also considering the cost budget can make each worker slower. pocketPG therefore treats worker count, cost limit, and delay as a coordinated decision instead of three independent toggles.
Decision sequence
The lead recommendation carries the decision sequence in its reason text:
- Per-table first — check whether per-table autovacuum overrides (in the Vacuum & Bloat tab) address the hot spots before touching globals.
- Adjust cost budget — increase throughput only when the evidence suggests vacuum is falling behind.
- Adjust worker count — add workers only when the cost budget can support them.
- Adjust delay carefully — avoid aggressive delay changes without understanding hardware and storage characteristics.
Priority
- Per-table-first when only a few hot tables are causing pressure.
- Higher priority when vacuum appears to be falling behind globally.
- No action when autovacuum is keeping up.
autovacuum_analyze_scale_factor
Separate from the throughput parameters, pocketPG checks whether table statistics are becoming stale and whether global or per-table analyze settings should be tightened. It does not loosen deliberately tightened settings automatically.
The Bloat tab's Vacuum Analysis section shows per-table autovacuum_analyze_scale_factor recommendations when stale statistics are detected. Global autovacuum_analyze_scale_factor is recommended at 0.1 when above the default.
autovacuum_vacuum_cost_limit = -1 in pg_settings means PostgreSQL inherits from vacuum_cost_limit. pocketPG resolves the inherited value before making a recommendation. Without this resolution, arithmetic on the raw -1 would produce invalid SQL like ALTER SYSTEM SET ... = -2.
Worker ceiling
On PostgreSQL 17+, the ceiling for autovacuum_max_workers is autovacuum_worker_slots. On earlier versions, the ceiling is max_worker_processes. pocketPG uses whichever is available and never recommends exceeding the hard cap.