model-writtenrun 4474 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ilya Gladyshev reported that recursive CREATE INDEX on nested partitioned tables overwrote progress totals and could report more completed partitions than the total; his initial patch used a static counter to avoid changing DefineIndex's ABI for possible backpatching #1.
- Justin Pryzby proposed counting only physical leaf partitions and updating progress at the top level, with experimental assertions to expose inconsistencies, but this made completion counts jump over nested groups #2 #4.
- The authors explored direct-child-only reporting, an IndexStmt counter, and an extra DefineIndex argument; Ilya preferred preserving fine-grained nested progress and eventually submitted a polished IndexStmt implementation with attached-index accounting and documentation #5 #6 #8.
- Tomas Vondra questioned using a statement-description structure for execution state and suggested reusing the existing progress counter, while Dean Rasheed proposed a dedicated increment function and a total fixed at command start #9 #11 #13.
- Ilya replaced the IndexStmt field with pgstat_progress_incr_param, then incorporated Justin's comments and cleanup and Alvaro Herrera's optimization to avoid descendant scans for ordinary attached leaf indexes #14 #15 #16 #17 #18.
- Matthias van de Meent questioned whether totals still changed during recursion, then acknowledged a misreading after Ilya explained the top-level guard; Justin subsequently clarified the comments and packaged his edits with supplementary assertions that were explicitly not proposed for commit #21 #22 #23 #24.
- Justin consolidated the main fix and its editorial follow-up into one patch, retained the experimental assertions, and later fixed a compiler warning in those assertions #25 #26.
- Tom Lane's March review challenged the cost and locking assumptions of count_leaf_partitions and proposed reusing the inheritance traversal already performed by ProcessUtilitySlow #27 #29 #31.
- Tom judged the bug insufficiently important for backpatching, removing the ABI constraint, and the discussion accepted approximate completion reporting when attaching an already-partitioned index rather than scanning its descendants again #32 #34 #35 #37.
- Justin added a DefineIndex parameter carrying the precomputed total, retained a fallback scan for other callers, and stopped counting descendants of attached partitioned indexes; Ilya checked ALTER TABLE locking and supplied cleanup suggestions that Justin incorporated #38 #39 #40.
- Tom then proposed eliminating relation-kind lookups by counting all descendants, and Justin revised both totals and completion increments to include intermediate partitioned indexes while excluding the root relation #41 #42.
- Tom argued for counting the root as well to avoid ambiguous zero totals, but Justin favored the simpler user-facing definition of number of partitions, and Tom dropped the objection #43 #44 #45.
- Tom committed the main fix from #42 as 27f5c712b2, crediting Ilya and Justin, with documentation and comment polishing, relocation of attached-index progress updates, and simplification of the increment helper #46.
- The main fix was landed at the thread's end, but the supplementary assertions were left out because Tom considered strict checks unsuitable for approximate progress estimates; Justin replied that they were diagnostic sanity checks and had exposed two other issues requiring fixes before the assertions could be proposed #46 #47.