model-writtenrun 8133 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Peter Geoghegan reported that tape-block preallocation inflated trace_sort and EXPLAIN ANALYZE disk-usage statistics, initially suggesting accounting for unused reservations in LogicalTapeSetBlocks() #1.
- During renewed investigation, Peter found a separate allocation-limit check that omitted the size of each freelist entry #3; Jeff Davis fixed it in 0852006a94.
- Peter isolated the sorting regression to preallocation and argued that external sorts could not benefit from it #4; Jeff submitted a switch disabling it for sorting while retaining it for HashAgg #5.
- Jeff explained that HashAgg benefited substantially from preallocation despite zero-filling overhead #6, and Peter approved the sort patch while requesting corrected comments about that behavior #7; it landed with that comment addition as 0758964963.
- Peter confirmed that sort statistics and temporary-file sizes again matched PostgreSQL 12, but identified HashAgg accounting as unfinished #8 #9.
- Peter submitted a tentative accounting fix using nBlocksWritten for preallocating tapes and retaining nBlocksAllocated for sorting #10; Jeff and Alvaro Herrera questioned why written blocks could not serve every caller #11 #12.
- Jeff recognized that HashAgg retained write buffers longer than intended and submitted an independent fix to rewind tapes immediately after spilling #17; Peter's testing found about a 50% reduction in temporary-file usage for one low-work_mem case #18.
- Peter accepted a uniform written-block count once callers had closed their write buffers and proposed asserting that condition for every tape #19 #20; Jeff implemented it, also moving HashAgg's metrics update after spill completion #23.
- Peter endorsed both remaining patches #28, while release coordination required waiting until PostgreSQL 13 RC1 was tagged before backpatching #26 #27.
- Tom Lane confirmed that the RC1 tag was applied #29; the final messages discussed delayed tag-notification emails and left their sender-address handling open #32 #33.
- After the thread's final message, Jeff committed the buffer-release patch unchanged as 3bd35d4f51 and the accounting patch with only clarified comment wording as c8aeaf3ab3, backpatching both to PostgreSQL 13 and completing the code fixes.