model-writtenrun 8634 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jeff Davis proposed excluding the untouched tail of AllocSet's current block from MemoryContextMemAllocated(), arguing that block doubling could make HashAgg spill prematurely while still counting fragmentation and other overhead #1.
- Jeff committed the original patch unchanged as e00912e11a to unblock disk-based hash aggregation, while reporting Andres Freund's off-list suggestion to refactor statistics collection with flags that avoid unnecessary scans #2.
- Robert Haas objected to the rapid landing without endorsement and questioned operating-system overcommit implications, while Tomas Vondra described the bounded allocation discrepancy and Jeff explained why default work_mem settings remained affected #3 #4 #5.
- Jeff reverted the change to allow further discussion; Robert subsequently withdrew his substantive concern after Jeff clarified that MemoryContextStats() was unaffected, while Jeff maintained that work_mem accounting should reflect memory the executor algorithm could control #7 #10 #11 #12.
- Jeff then proposed a broader refactoring for PostgreSQL 14 that separated counter collection from printing, added untouched-space accounting, and let callers select counters to avoid expensive scans, while still seeking a smaller PostgreSQL 13 fix #15.
- Andres requested fewer branches and clearer flag semantics, and David Rowley identified stale comments, questioned API naming and struct returns, and measured a slowdown; Jeff incorporated their feedback into MemoryContextGetCounters with an output pointer and reported a reduced but remaining performance cost #16 #17 #18.
- David continued advocating separate recursive and nonrecursive entry points for readability and performance, but that API question was not resolved before the approach changed #20.
- Jeff switched to limiting HashAgg's allocation block size relative to work_mem through CreateWorkExprContext(), leaving broader use by other operators for later investigation; this narrower patch landed unchanged as 50a38f6517 #21.
- Daniel Gustafsson closed the July commitfest entry as committed while asking whether anything remained for PostgreSQL 14; the supplied thread ends without an answer or a landing of the broader counter refactoring #22.