autovacuum_naptime
Read PG 18 manual ↗Specifies the minimum delay between autovacuum runs on any given database.
- Type
- integer
- Context
- sighup
- Measured default
- 1 min
- Unit
- s
- Metadata snapshot
- 18
Definition PG 18 manual
Specifies the minimum delay between autovacuum runs on any given database. In each round the daemon examines the database and issues VACUUM and ANALYZE commands as needed for tables in that database. If this value is specified without units, it is taken as seconds. The default is one minute (1min). This parameter can only be set in the postgresql.conf file or on the server command line.
Measured default history
| Version interval | Default |
|---|---|
| 9.0 – 19 | 1 min |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
Time to sleep between autovacuum runs. A configuration reload applies a new value; existing work already in flight is not retroactively changed.
The launcher aims to start work in each database once per interval; with N databases, launch attempts are spread at roughly naptime/N. It is not a fixed per-table polling period, and worker availability plus long-running jobs can add delay.
Monitor and change autovacuum_naptime together with autovacuum, autovacuum_max_workers, autovacuum_worker_slots. Validate on the relevant server role and real workload, then use its sighup context to choose session change, reload, or restart; a historical boot default is not the current effective value.
Operational considerations
Changing the global value while a table storage parameter overrides it.
Treating reltuples and cumulative change statistics as exact real-time counts.
Blaming a threshold without checking long transactions, replication slots, and worker saturation.
Buying short-term quiet by deferring maintenance until wraparound failsafe activates.
Workload guidance
OLAP: Run explicit ANALYZE/VACUUM after bulk loads instead of waiting only for proportional triggers; plan freezing and visibility-map advancement separately for append-only partitions.
OLTP: Tune autovacuum_naptime from table size, change rate, and maintenance SLA, using per-table thresholds for large/hot relations. Observe trigger intervals, dead tuples, and ANALYZE/VACUUM duration.
SMALL: Start with upstream. Fixed thresholds dominate on small tables; after changes, confirm worker and I/O headroom.
Version history 2
- PG 17 → 18changed
- PG 11 → 12changed
Related entries
Further reading
Definition snapshot: english-manuals:d2fbf5288033192f3e1e2fd305d… · English manual source