model-writtenrun 1355 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andres Freund opened the thread with profiling evidence of repeated scan-state loads, per-tuple CheckXidAlive checks, redundant tuple-null checks and table-OID stores, and missed sibling-call opportunities in sequential scans #1.
- Amit Langote proposed a first-call initialization wrapper and an inline pg_assume() expression #2, while David Rowley attached an alternative moving table_beginscan() into ExecInitSeqScan(), reporting about 4% improvement and separately observing that SeqNext() was not inlined #3.
- Amit Kapila explained that CheckXidAlive protects logical decoding against output plugins bypassing systable APIs #4, and Andres argued that this protection should run at scan startup rather than for every tuple #5.
- Andres supported earlier scan initialization but questioned serial execution of parallel plans #6; David investigated that concern and identified a statistics change whereby initialized but unexecuted sequential scans would be counted #8.
- David independently committed forced inlining of SeqNext() and SeqRecheck() as 83a53572a6, reporting a 3.9% improvement and confirming that the change also fixed Clang's failure to inline at -O2 #9.
- David confirmed that the proposed pg_assume() removed a redundant check in generated code #10, but Amit Langote initially found no measurable benchmark improvement #11.
- Amit Kapila endorsed moving CheckXidAlive into a scan_begin() wrapper after finding no reason the check needed to remain per tuple #12.
- Heikki Linnakangas proposed restructuring ExecScanExtended() to avoid repeated state loads #13, while Andres prototyped passing state through callback arguments #16; their subsequent discussion broadened to instrumentation, memory-context operations and expression-evaluation overhead without settling a replacement architecture #18 #20.
- Further pg_assume() testing produced mixed results: Andres measured about 3.5% improvement after freezing the table #15, whereas Amit Langote still found no measurable improvement on his VM #17.
- Dilip Kumar submitted the separate CheckXidAlive relocation patch #19, then moved its wrapper into tableam.h and renamed it following Andres's review #21 #22.
- Andres found that the revised patch removed protections from APIs not covered by the common table-scan initializer #23; Dilip corrected this by retaining the row-version check and adding the index-fetch startup check in the final submission #24.
- Andres committed that final submission as 87f7b824f2 with light naming, comment, error-message and formatting edits, announcing completion in the thread's last message #25.
- At the close, forced inlining and the CheckXidAlive optimization had landed, while David's scan-initialization patch #3, the pg_assume() proposal #2, and the broader executor restructuring ideas #16 #20 had no recorded landing or withdrawal in this thread.