model-writtenrun 2184 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tomas Vondra reported severe checksum-related throughput losses on large machines despite a read-only, memory-resident workload in #1; discussion with Aleksander Alekseev ruled against ordinary hint-bit work or sleeping lock waits as the explanation in #3 and #5.
- Tomas traced the problem to contention between buffer pin operations and BufferGetLSNAtomic() acquiring the buffer-header lock in #6, while Peter Geoghegan explained that index-only and bitmap scans did not need those LSN reads in #7.
- Peter supplied the initial index-only-scan optimization in #8, and Tomas measured a substantial recovery while identifying remaining plain-index-scan contention in #9.
- Peter extended the optimization in #11 to bitmap scans and delayed LSN acquisition until a page actually supplied tuples; Tomas's broader tests in #21 confirmed improvements over the initial patch across scan types and workloads.
- Andres Freund proposed using untorn eight-byte reads to avoid the buffer-header lock in #12; Peter and Andres agreed that this could complement the nbtree optimization in #13 and #19, while Peter also proposed eventually sharing pin-safety machinery across index access methods in #20.
- Tomas reported release-team support for including the optimization in PostgreSQL 18 because checksums would become the default in #22, and Peter prepared #24 with clearer comments, additional assertions, and initialization moved to btrescan().
- Peter committed #24 with naming, documentation, and equivalent control-flow cleanup as e6eed40e44, announcing in #25 that the broader atomic-read improvement appeared unlikely to reach PostgreSQL 18.
- Alexander Lakhin supplied a SQLsmith-derived reproducer for a newly exposed assertion failure in #26; Peter diagnosed an older mark/restore pin-management problem and supplied #28 so that _bt_killitems() would preserve its caller's pin state.
- Mihail Nikalayeu questioned the absence of dropPin initialization in btbeginscan() in #27, and Peter explained in #29 that initialization belongs in btrescan(), where the necessary scan properties are available.
- Peter expanded the fix in #30 to make pin release depend on dropPin and transfer existing pins during mark/restore, eliminating conditional-unpin macros and redundant reference-count increments.
- Peter split that work in #31 into a minimal fix for all supported branches and a broader refactor, deferring the refactor until PostgreSQL 18 branched because it was difficult to justify including it that late in the release.
- The first component of #31 landed as 38c8d29870, with the supplied commit adapting the fix to older pin-state machinery; #32 confirms backpatching to all supported releases and leaves the refactor deferred.
- In the final message #32, Peter reconsidered the suspected corruption risk on older releases, explaining that the earlier LSN check and retained pin might already prevent it, while maintaining that the fix was warranted and promising a dedicated follow-up thread.