max_parallel_maintenance_workers
Parallel workers one CREATE INDEX (B-tree, BRIN, GIN in 18) or VACUUM can use.
- Par défaut
2- Range
- 0 to 1024
- Restart needed
- Non
- Default checked on
- PostgreSQL 18
Ce que cela fait
Parallel index builds arrived in PostgreSQL 11 for B-tree, BRIN in 17 and GIN in 18; VACUUM can process indexes in parallel from 13 (not autovacuum).
Valeur par défaut
2. 2 (PostgreSQL 18).
Check the current value
SHOW max_parallel_maintenance_workers; SELECT setting, unit, boot_val, context, source, pending_restart FROM pg_settings WHERE name = 'max_parallel_maintenance_workers';
Change it
SET max_parallel_maintenance_workers = 4; -- this session ALTER ROLE reporting SET max_parallel_maintenance_workers = 4; -- new sessions of one role ALTER SYSTEM SET max_parallel_maintenance_workers = 4; SELECT pg_reload_conf();
No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).
When to change it
Raise in the session that rebuilds large indexes during a maintenance window.
What can go wrong
The workers share maintenance_work_mem; they also draw from max_parallel_workers.
Questions about max_parallel_maintenance_workers
What is the default value of max_parallel_maintenance_workers in PostgreSQL?
2. 2 (PostgreSQL 18).
Does changing max_parallel_maintenance_workers require a restart?
No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).
When should I change max_parallel_maintenance_workers?
Raise in the session that rebuilds large indexes during a maintenance window.
Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.
Check max_parallel_maintenance_workers 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.