model-writtenrun 8138 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Thomas Munro opened the thread with a specialized sort for compactify_tuples(), reducing his crash-recovery benchmark from roughly 55.5 to 49.5 seconds, and proposed consolidating existing sorting implementations in #1.
- Peter Geoghegan noted that B-tree deduplication had avoided a similar bottleneck through a temporary page in #2; Thomas expanded his proposal into a shared sorting template in #3 and cleaned up copyright and build integration in #4.
- David Rowley measured a recovery improvement with Thomas's patch in #5, then supplied a different implementation using a temporary buffer to avoid sorting most pages, reducing his benchmark to about 79 seconds in #6.
- Thomas proposed batching adjacent tuple copies, reconsidering tuple order and adding an in-place path for already-ordered tuples in #7; he also suggested moving the general sorting work to a future thread with another use case.
- David eliminated the remaining sort fallback in #9, choosing individual backup copies when more than 75% of tuples were pruned and bulk copying otherwise; he rejected moving compaction into PageRepairFragmentation's existing loop because benchmarks were slower.
- After Thomas clarified how tuple order could be changed without sorting in #10, David added ascending tuple placement, a presorted fast path and batched copies in #11, while leaving a slower experimental backup-copy optimization disabled.
- Thomas independently measured a substantial recovery improvement, proposed skipping tuples already compacted at the page end, and questioned whether reversing traditional tuple order belonged in this patch in #12.
- David's experiments in #13 favored traditional reverse line-pointer order because subsequent inserts preserved it, increasing presorted-path use from about 13% to 60%; he also introduced a separate patch to log recovery CPU and elapsed time.
- David further reduced copying by skipping stationary tuples before backup and compaction, removed the disabled experiment, and reported a roughly 60.8-second benchmark in #14.
- Thomas reported an nitems > 0 assertion failure in #16; David fixed empty index-page handling, added index-page presorted detection, and posted both patches for commitment in #17, declining to pursue prefetching without existing supporting macros.
- Jakub Wartak tested both final patches, reported successful check-world and recovered-data checks, and measured approximately 9–10% and 2.3-fold recovery improvements on two workloads in #18.
- David committed recovery-resource reporting unchanged from #17 as 10a5b35a00 and committed compaction with comment and commit-message cleanup as 19c60ad69a, announcing both landings and additional VACUUM improvements in #19.
- After both patches landed, Simon Riggs questioned the placement of pg_rusage_init() in #22; David explained that initialization and reporting already shared the recovery scope and requested a concrete clarification in #25, leaving that question unresolved with no further patch posted.