model-writtenrun 4951 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Heikki Linnakangas proposed replacing polyphase merging with simpler balanced k-way merging in #1, combining the algorithm change with dynamic LogicalTape creation and relying initially on separate tape pause/resume work.
- Tom Lane questioned whether the change would sacrifice incremental temporary-disk reuse in #2, and Heikki explained in #3 that logtape.c preserves that property independently of the merge pattern.
- Peter Geoghegan supported the simplification in #4 and later illustrated wasteful polyphase merge scheduling, questioned the pause/resume dependency, and suggested clearer tape API terminology in #5.
- After the patch was returned with feedback in #6, Peter proposed also removing replacement selection in #7, but Robert Haas argued that it belonged in a separate discussion in #8; that removal was not included in this series.
- Heikki revived the work after several years in #11, separating the LogicalTape API refactoring from balanced merging, simplifying hash-aggregation spilling, dropping the pause/resume dependency, and reporting faster sorts at low work_mem with supplementary benchmark scripts.
- A FreeBSD CI failure exposed negative read-buffer sizes wrapping into huge allocations, so Heikki added a zero clamp as a separate reviewable fix in #12 and folded it into the rebased merge patch in #16.
- Zhihong Yu identified the stale PostgreSQL version comment and suggested unsigned buffer-size arithmetic in #18; after the rebase in #20, John Naylor reviewed and benchmarked both patches in #21, while Peter explained why memory accounting must remain signed in #22.
- Heikki landed both components of #20 on 18 October 2021: c4649cce39 matches the API patch unchanged, and 65014000b3 matches the merge patch with the release comment corrected to PostgreSQL 15, as announced in #23.
- Peter Eisentraut reopened the thread in #24 after noticing that LogicalTapeSetCreate() still documented a removed argument and inadequately described its callers and preallocation option; Heikki supplied a comment-only repair in #25.
- Peter endorsed the revised wording in #26 and later urged committing it while treating the deeper preallocation questions separately in #27.
- Heikki committed the comment patch unchanged as 236f1ea84c, also backpatching it to PostgreSQL 15, and confirmed in #28 that all submitted implementation and documentation changes had landed while fuller explanation of when preallocation is necessary remained desirable.