model-writtenrun 4855 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Gunnar L reported severe vacuumdb slowdowns beginning with PostgreSQL 12 on databases containing 125,000 tables, alongside PostgreSQL 15 shared-memory exhaustion #1.
- Tom Lane traced the slowdown to vacuumdb issuing one VACUUM per table, repeatedly scanning pg_class in vac_update_datfrozenxid() and serializing parallel workers; he suggested whole-database VACUUM as a workaround and explicit control over the final update as a durable fix #2.
- Peter Geoghegan proposed moving the housekeeping responsibility toward autovacuum, but Tom argued that users disabling autovacuum still needed a reliable manual route #3 #4.
- Peter and Tom explored skipping updates unless vacuumed tables could advance the database's oldest transaction IDs, seeking a fix suitable for backpatching #5 #6 #7.
- Michael Paquier explored configurable batching because fixed batches could harm parallel scheduling, while Christophe Pettus questioned how administrators would choose a batch size; Nathan Bossart separately proposed an explicit function for the final database update #9 #10 #11 #12.
- Tom abandoned the automatic-skipping approach because dropping an old table or database could require advancing transaction limits even without relevant vacuum activity, and posted SKIP_DATABASE_STATS and ONLY_DATABASE_STATS with a measured runtime improvement on the regression database #13.
- Nathan posted an independently developed alternative using UPDATE_DATFROZENXID and a SQL function, but accepted Tom's objection that a user-controlled transaction could retain the database frozen-ID lock and block other VACUUMs #14 #15 #17.
- Nathan identified that the final command should use the parallel-slot machinery and that completed slots needed to become reusable; Tom agreed to incorporate that implementation change #16 #18.
- Justin Pryzby challenged the two-option interface, prompting discussion of a single multivalued option, but ONLY being a reserved keyword made the proposed syntax awkward and Nathan ultimately endorsed the original two options #19 #23 #24 #27 #28.
- Andres Freund suggested avoiding some updates and optimizing the catalog scan, while Nathan explored stopping scans early; these remained separate optimization ideas rather than part of the submitted solution #22 #26.
- At the thread's end, Tom announced proceeding on the development branch only, retaining his syntax and incorporating Nathan's parallel machinery; the resulting commit also allowed VERBOSE with ONLY_DATABASE_STATS #29 a46a7011b2.
- The committed fix targets PostgreSQL 16, leaving the performance regression in versions 12–15 without a backpatch; further scan optimizations remained open, and the original shared-memory report was not resolved in this thread #1 #29 a46a7011b2.