model-writtenrun 4058 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reproduced poor parallel pg_restore utilization with 100,000 tables and traced it to repeatedly sorting the ready list whenever completed table loads released dependent jobs, producing approximately quadratic-times-logarithmic scheduling work #1.
- Andres Freund suggested incremental sorting or merging sorted arrays, and Andrew Dunstan supported sorting less frequently, but Tom favored a priority heap scanned sequentially when its root was blocked because that preserved immediate dispatch of the largest runnable root task #2 #3 #4.
- Nathan Bossart volunteered and posted an initial binaryheap frontend/removal prototype; Alvaro Herrera pointed out that frontend palloc already existed, eliminating an unnecessary allocation conditional #5 #6 #7 #8.
- Nathan expanded the prototype into a complete restore series and reported reducing the 100,000-table example from 11.5 minutes to 1.5 minutes, while identifying frontend access to Datum as an unresolved design problem #9.
- Nathan next moved Datum definitions into c.h, but Tom objected that frontend Datum usage would violate the backend abstraction and proposed preserving Datum for backend callers while exposing a void-pointer frontend interface #10 #12.
- Nathan first tried converting every binaryheap caller to void pointers; Pierre Ducroquet tested that version on a database with over 50,000 tables and reported a restore reduction from 30 to 23 minutes, while noting further opportunities for parallelizing schema work #13 #14.
- Nathan then implemented the separate frontend/backend interfaces, polished their documentation, and added a fourth patch replacing the private heap in pg_dump_sort.c with the shared binaryheap implementation #15 #16.
- After the July-to-September pause, Nathan proposed committing the series, but Robert Haas suggested allowing arbitrary C element types, prompting a standalone prototype with element sizes, copied values, and output parameters #17 #20 #22.
- Alvaro questioned the generic prototype's missing const qualifiers and output-parameter API; Nathan explained the copying requirements, refined the implementation, and adapted the full series to it #23 #24 #25.
- Tom rejected the generic version because it complicated existing callers and could slow pass-by-value elements, instead endorsing the earlier dual-interface series with small typedef, brace, documentation, and cast fixes; Nathan returned to that branch and applied the requested changes #26 #27.
- Nathan then discovered that the restore heap comparator passed TocEntry pointers where the qsort comparator required pointers to pointers, fixed the indirection, and investigated scheduling order after Tom recommended additional tests #28 #29.
- Further testing exposed a second comparator bug that produced a min-heap; Nathan reversed the comparison for a max-heap and reported that a varying-size 10,000-table test fell from over 16 minutes to just over one minute #30.
- Nathan committed the frontend-support and arbitrary-node-removal components from the final submission without code changes as 5af0263afd and c103d07381, announcing that the other two patches would follow #30 #31.
- The initial landing exposed missing updates to the MSVC build scripts: Tom reported the bowerbird failure, and Nathan said he had already committed an attempted fix and was waiting for an MSVC buildfarm result #32 #33.
- The build failure also prompted discussion of retiring src/tools/msvc; Michael Paquier identified remaining affected buildfarm members, while Nathan pointed to existing removal work and left that separate task available for someone else #34 #35 #36.
- The restore conversion from #30 landed with only comment wording changes as 9bfd44bbde, followed by the pg_dump heap replacement with comment edits and an explicit integer-comparison implementation as 559bc17321; Nathan's final message confirmed that all remaining patches had been committed #37.