// postgresql · vacuum, statistics & maintenance

autovacuum_naptime

Delay between autovacuum runs on any given database.

預設
1min
Range
1s to about 24 days
Restart needed
否
Default checked on
PostgreSQL 18

其作用

The launcher starts a worker for each database once per naptime, so with many databases workers start more often.

預設值

1min. 1min (PostgreSQL 18).

Check the current value

SHOW autovacuum_naptime;

SELECT setting, unit, boot_val, context, source, pending_restart
FROM pg_settings
WHERE name = 'autovacuum_naptime';

Change it

ALTER SYSTEM SET autovacuum_naptime = '15s';
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

Shorten it for databases with a few very hot tables that bloat within a minute.

What can go wrong

Very short values add catalog-scanning overhead on clusters with many databases.

Questions about autovacuum_naptime

What is the default value of autovacuum_naptime in PostgreSQL?

1min. 1min (PostgreSQL 18).

Does changing autovacuum_naptime 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_naptime?

Shorten it for databases with a few very hot tables that bloat within a minute.

Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.

// one client for every engine

Check autovacuum_naptime 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.