Parameter · Resource Usage / Worker Processes
max_parallel_maintenance_workers
Sets the maximum number of parallel processes per maintenance operation.
- Default:
2 - Type: integer
- Range: 0 … 1024
- Applies: Session (any user)
In plain words
CREATE INDEX (B-tree, GIN, BRIN) and VACUUM of a table's indexes can use helper processes. This caps how many one command may use. Unlike queries, these share one maintenance_work_mem budget instead of each getting their own.
For DBAs and operators
Parallel B-tree builds since PostgreSQL 11, BRIN since 17, GIN since 18. VACUUM processes indexes in parallel (one worker per index ≥ min_parallel_index_scan_size) when run as VACUUM (PARALLEL n) or by default for manual VACUUM; autovacuum never uses parallel workers. Workers come from max_worker_processes, limited by max_parallel_workers.
Memory: the whole command uses at most maintenance_work_mem, split among participants; for a parallel index build each participant needs at least 32 MB, otherwise fewer workers are used. Log/verbose output: INFO: launched 2 parallel vacuum workers for index vacuuming (planned: 2). Progress: pg_stat_progress_create_index. For large index builds during a maintenance window, 4–8 with a large maintenance_work_mem is common.
How to change it
Any user can change it for their session with SET.
See it in context
Parallel and background workers VACUUM B-tree indexes Local (per-backend) memory
Related parameters
maintenance_work_mem max_parallel_workers max_worker_processes min_parallel_index_scan_size