autovacuum
Whether the autovacuum launcher runs.
- Standard
on- Range
- on, off
- Restart needed
- Nein
- Default checked on
- PostgreSQL 18
Was es bewirkt
Autovacuum removes dead row versions, updates the visibility map, refreshes planner statistics and freezes old transaction IDs. Even with it off, the server still launches anti-wraparound vacuums when needed.
Standardwert
on. on (PostgreSQL 18).
Check the current value
SHOW autovacuum; SELECT setting, unit, boot_val, context, source, pending_restart FROM pg_settings WHERE name = 'autovacuum';
Change it
ALTER SYSTEM SET autovacuum = on; SELECT pg_reload_conf();
No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).
When to change it
Leave it on. To exempt one table during a bulk load, use ALTER TABLE ... SET (autovacuum_enabled = false) and re-enable it afterwards.
What can go wrong
Off server-wide leads to table bloat, stale statistics and eventually forced anti-wraparound vacuums at a bad moment.
Questions about autovacuum
What is the default value of autovacuum in PostgreSQL?
on. on (PostgreSQL 18).
Does changing autovacuum require a restart?
No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).
When should I change autovacuum?
Leave it on. To exempt one table during a bulk load, use ALTER TABLE ... SET (autovacuum_enabled = false) and re-enable it afterwards.
Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.
Check autovacuum on your own server
SQLly runs the query above against PostgreSQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.