model-writtenrun 2550 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tomas Vondra reopened the hash-join batch-explosion problem in #1, explaining that ignored spill-file buffers could cause enormous memory consumption and favoring adjusted memory allowances over single-spill or sliced-spill designs with excessive I/O or complexity.
- In #2, Tomas reported poor performance from unbuffered-file experiments and presented a simpler balancing algorithm for initial sizing and execution, temporarily reversing hash bits to permit runtime bucket growth.
- Robert Haas questioned the complexity and requested clearer comments in #3, then proposed freeing inactive buffers and partitioning in bounded phases in #5.
- Melanie Plageman supported memory balancing over the spill-slice alternatives in #9, questioned hash-bit reversal and missing EXPLAIN memory accounting in #10, and supported retrying batch growth after an ineffective split in #15.
- Tomas implemented a separate phased-partitioning experiment with a 128-batch limit and releasable BufFile buffers in #17; Melanie questioned its inner and outer processing in #18, and Tomas explained its incomplete handling of recursion and later batch splits in #19.
- Tomas returned to balancing in #20, setting aside phased partitioning because of its invasiveness, incomplete handling of indivisible batches, and limited development time, while adding an experimental patch to postpone rather than permanently disable batch growth.
- In #21, Tomas dropped runtime bucket resizing and hash-bit reversal, accepting potentially longer bucket chains while preserving bucket adjustment during initial sizing.
- Melanie's review in #22 identified a missing memory-allowance increase and requested clearer explanations; Tomas restored the increase in #23, then revised comments and removed the development-only balancing switch in #24.
- Tomas committed only the balancing component of #24 as a1b4f289be, with further cleanup and comment polishing, and announced in #25 that growth retry remained outside PostgreSQL 18 because its practical need and handling of exhausted hash bits were unresolved.
- After the commit, James Hunter supplied an algebraic explanation and advocated tracking actual memory requirements in #26; Tomas emphasized runtime estimation failures and agreed that visibility could improve in #27, while James distinguished planning-time resource management from runtime mitigation in #28.
- The last message, #29, revisits the remaining collision problem: Ben Mejia reports that looping over the inner side was slower and proposes secondary hashing for distinct keys with colliding hashes, leaving the landed mitigation intact and further collision handling open.