model-writtenrun 7134 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Melanie Plageman opened the thread with #1, separating page reading from visibility processing and changing heap scans to stop when buffers, rather than requested block numbers, are exhausted; her stack also included the streaming API prerequisite and a forward-only scan consumer.
- David Rowley requested a benchmark that filtered out every tuple in #2, and Melanie reported essentially unchanged execution time for the preliminary refactors in #3.
- Melanie compared allocation and direction-change designs in #4; Robert Haas proposed a way to discard outstanding requests in #5, leading to the reset operation in #7.
- In #8, Melanie chose a persistent stream allocated in heap_beginscan(), reset it on rescans and page-level direction changes, removed the non-streaming fallback, and extended streaming to TID range scans.
- Performance work produced better descriptor packing after Andres Freund's feedback in #9, restored branch hints and revised ramp-up logic in #10, and brought in the newer vectored-read and streaming API stack in #11.
- Melanie investigated a small cached-scan regression and adjusted inlining in #12, while Heikki Linnakangas demonstrated a substantial speedup for a sparse table in #13.
- Once the streaming API prerequisite had landed, #14 reduced the series to the two heap refactors and scan consumer, while raising the need to prevent streaming lookahead from pinning too much of a buffer-strategy ring.
- Thomas Munro proposed clamping pinned buffers in #15, Melanie questioned the limits in #16, and Andres argued in #17 for distinguishing bulk-read behavior from strategies that need space to defer dirty-page writeback and WAL flushing.
- David revised the preliminary refactor's naming, assertions, and comments in #18, then committed it as 44086b0975 with the final heap_prepare_pagescan() name confirmed in #20.
- David committed the second refactor from #14 as 3a4a3537a9, correcting function attributes and naming; #21 supplied the remaining scan patch and reported a cached-workload regression before handing further committing to Thomas.
- Thomas explored page-header memory prefetching in #24, but Melanie identified the immediate regression cause in #26: ordinary cached scans could not enter a fast path specialized for pg_prewarm's initial lookahead distance.
- Thomas supplied a fast-path repair and optional memory-prefetch experiments in #29; Melanie confirmed the repair's performance and reviewed it in #31, and Thomas corrected stale rescan state and assembled the expanded stack in #32.
- The fast-path component of #32 landed unchanged as aa1e8c2064 after Melanie's final review in #33; Thomas deferred the memory-prefetch experiments while checking for possible downsides.
- The strategy pin-limit component of #32 landed as 3bd8439ed6 with Melanie's comment correction, and its separate increase of the vacuum ring default to 2MB landed unchanged as 98f320eb2e; the related WAL-flush discussion in thread #48989 supplied supporting analysis, while the matching patch was posted here.
- Parallel-scan testing exposed a pending-read edge case that could skip blocks, so Thomas posted an if-to-while fix in #34; Melanie included it in #35, and it landed separately as 158f581923.
- Following Andres's off-list review, Melanie separated parallel and serial scan callbacks in #35; Thomas committed that consumer as b7b0f3f272 with only the naming, typedef, and comment changes described in #36.
- Alexander Lakhin reported a TPC-DS regression bisected to b7b0f3f272 in #38; Thomas and Andres's investigation, reported in #40 and #41, connected unfair cached-scan allocation with pre-existing parallel-hash behavior and poor estimates.
- Alexander found that reducing block-number batching usually improved the query but did not eliminate timing variability in #42; Thomas explained in #45 how batching amplified worker imbalance and exposed an existing parallel-hash growth-coordination problem.
- After the summer gap, Thomas posted #46, replacing the sixteen-entry block-number array with a single buffered block to restore fairer allocation, while leaving the broader query-plan and parallel-hash issues for separate investigation.
- Alexander's initially unstable tests in #47 were traced to CPU frequency scaling, and his controlled measurements in #51 confirmed the fairness improvement.
- Thomas landed #46 with comment edits as 4effd0844d, including a backport to PostgreSQL 17, and confirmed the push in #52; the core scan work and this fairness repair were complete, while the memory-prefetch experiments and broader performance questions had no further resolution in this thread.