Configuration parameter

autovacuum_max_parallel_workers — PostgreSQL configuration parameter

Category Vacuuming Default 0

Sets the maximum number of parallel workers that can be used by a single autovacuum worker to process indexes.

At a glance

Property Value
Parameter autovacuum_max_parallel_workers
Category Vacuuming
Default 0
Value type integer
Change scope Per-session (SET)
Available in PostgreSQL 19 (added in 19)

What it does

Sets the maximum number of parallel workers that can be used by a single autovacuum worker to process indexes. This limit applies specifically to the index vacuuming and index cleanup phases (for the details of each autovacuum phase, please refer to vacuum_phases). The actual number of parallel workers is further limited by max_parallel_workers. This is the per-autovacuum worker equivalent of the PARALLEL option of the VACUUM command. Setting this value to 0 disables parallel vacuum during autovacuum. The default is 0.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW autovacuum_max_parallel_workers; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'autovacuum_max_parallel_workers';.

Tuning guidance

Raise it to let autovacuum parallelize index vacuuming on large tables when cores are free; it draws from the parallel worker pool, so size max_parallel_workers accordingly.

Reference

PostgreSQL documentation — autovacuum_max_parallel_workers.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters