model-writtenrun 4920 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Simon Riggs proposed reducing SUBTRANS contention by recording subtransaction parents only when needed, retaining cached subxids in overflowed snapshots, and using procarray information during lock waits, with isolation tests accompanying the implementation #1.
- Dilip Kumar identified that omitting parent records could produce incorrect snapshot answers unless XidInMVCCSnapshot() searched cached subxids first; Simon acknowledged an overlooked dependency on his related performance work and promised a test and an integrated fix #4 #5.
- Simon merged the related work into a revised optimization and expanded the independent isolation tests to cover overflow visibility and lock waits, establishing a baseline that could land separately #7.
- Dilip questioned the claimed lock-wait downside, outdated recovery comments, and redundant parent traversal; Simon accepted these points and supplied both an incremental correction and a complete revised series that removed the extra traversal helper #8 #9 #10 #11.
- Alvaro Herrera verified the increased test coverage and committed only the isolation-test component of #11 as 0e733278e3, preserving the test specification and expected output while moving its schedule entry and adding a source comment; Simon then reposted the uncommitted optimization alone #12 #13.
- Japin Li suggested comment corrections and avoiding repeated GetTopTransactionId() calls, which Simon incorporated before rebasing the optimization over an upstream procarray search change #14 #15 #16.
- Julien Tachoires reported that the optimization prevented the severe throughput collapse in his overflow benchmarks and supplied wait-event samples at Dilip's request; Simon subsequently marked the work ready for a committer #17 #18 #19 #20.
- After Simon refreshed the patch, Tom Lane challenged its assumptions about serializable transactions, overflowed snapshots, and commit-status pages; Simon explained the intended invariants, and Dilip confirmed that retaining and searching cached subxids addressed the snapshot objection #21 #23 #24 #25 #26 #27.
- Tom accepted the clarification about snapshot handling but remained concerned about fragile assumptions and stale documentation, recommending that flattening the parent structure be separated from suppressing SUBTRANS writes #28.
- Simon split the work into a lookup redesign with flattened parent traversal and a second patch for conditional writes, adding extensive comments; Julien's new measurements suggested the first part delivered nearly all the measured benefit, so Simon retained the second mainly for possible future workloads #29 #30.
- Tomas Vondra questioned the page-check helper's naming, and Simon clarified that it referred to clog pages using the pg_xact terminology #31 #32.
- Simon then reduced the proposal to a one-line change recording the top-level transaction as each subtransaction's parent, reporting a remaining performance benefit; after Tomas requested reproducible benchmark details, Julien reposted the scripts with a minor correction #33 #34 #35.
- The thread ended with only the isolation tests landed: Tom requested consistent documentation, consideration of ProcessTwoPhaseBuffer(), and simplified lookup code, while he, Andres Freund, and Robert Haas remained concerned about losing the subtransaction tree information; Andres also pointed to snapshot caching as an alternative optimization #36 #37 #38.