/explain/maintenance_work_mem

maintenance_work_mem

The memory a vacuum may use for its dead-TID store, default 64 MB. Before Postgres 17 this was the hidden multiplier on vacuum cost: 64 MB held about 11M TIDs, and a table with more dead rows than that forced vacuum to stop, scan every index, and start again: multiple full index passes per run, capped further by a hard 1 GB limit. Postgres 17 replaced the array with an adaptive radix tree: ~20× more TIDs per MB, no 1 GB cap, and almost always a single index pass.

SEE ALSO
autovacuum_vacuum_cost_limitbloat← back to start
autovacuum_work_mem overrides it for autovacuum workers. Production guidance: ~1% of RAM capped around 1-5 GB; on 17+ the setting matters far less for vacuum.
maintenance_work_mem — robovac