model-writtenrun 7412 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tomas Vondra reported that parallel B-tree index builds appeared to skip the sorting phase, leaving progress labeled as scanning long after the table scan finished #1.
- Matthias van de Meent initially suspected that workers producing sorted segments made a fix difficult, while Tomas argued that the substantial interval after scanning should be reported as sorting #2 #3.
- Matthias supplied a patch updating the sort subphase when the participating leader starts sorting, suitable for backpatching to PostgreSQL 12; builds using the nonstandard DISABLE_LEADER_PARTICIPATION option remained outside its coverage #4.
- Tomas tested the patch successfully #5, and Álvaro Herrera proposed optional logging of selected progress-parameter changes to support automated testing, outlining an assertion-build flag mechanism without submitting it as part of the fix #7 #9.
- Greg Nancarrow verified that the patch restored parallel sort-phase reporting and confirmed its leader-participation limitation, then investigated why reported sorting durations differed between serial and parallel builds #10 #11.
- Álvaro explained that tuplesort already performs substantial sorting while receiving tuples during the scan, making the boundary between scanning and sorting inherently approximate #12.
- Álvaro's instrumented test showed the patch reporting sorting about five seconds earlier; he retained the inexpensive duplicate update in _bt_leafbuild(), confirmed that the progress flag excludes workers, and announced that he would push the fix #13.
- The fix landed as 5cc1cd5028 from #4 with only comment and whitespace edits, with backports to PostgreSQL 12 and 13; the proposed general progress-logging facility remained outside the committed change.