model-writtenrun 4980 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ranier Vilela proposed sharing catalog index state across repeated inserts and updates in statistics, enum, text-search, and role-membership operations, reporting faster REINDEX CONCURRENTLY runs #1.
- Kyotaro Horiguchi supported the cleanup while questioning its overall performance impact and suggested multi-inserts and possible operator-class optimizations; Ranier initially preferred simpler WithInfo calls because of slot-management complexity and allocation costs #2 #3.
- After a gap until November, Michael Paquier supported investigating each affected path and measured an extreme REINDEX CONCURRENTLY workload improving from roughly 1550 ms to 1480 ms, then proposed batching inserts to reduce WAL records #4 #6.
- Ranier argued that batching was too complex for CopyStatistics(), whose tuple count is unknown; Michael accepted keeping that path simple and noted that ANALYZE mixes updates with inserts, while enum creation was a suitable batching candidate #7 #8.
- Michael supplied a substantial revision that opened statistics indexes only when needed and implemented bounded batches for enums and text-search mappings, initializing slots lazily when scanning an unknown number of mappings #9.
- Ranier accepted the revision but asked about the omitted AddRoleMems() change; Michael explained that optional index-state management would complicate already complex code for a workload usually involving one role, so that optimization was deliberately left out #10 #11.
- The statistics portion of the revised patch landed unchanged in 09a72188cd, preserving shared index state without unnecessary opening for empty operations #9.
- Enum batching from the same revision landed in 1ff4161218 with an equivalent pointer-typedef cleanup, and text-search batching landed with formatting changes in 63c833f4bd #9.
- Michael confirmed that the revised patch had been split into three commits and fully applied, leaving possible operator-class optimizations for later; Ranier thanked him in the final reply #12 #13.