model-writtenrun 7808 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Pavel Stehule proposed retaining CALL/DO plans across transaction boundaries through a local ResourceOwner, reporting substantial CALL speedups but a slowdown for ordinary function execution from unconditional owner creation #1.
- Pavel's profiling attributed much of the remaining overhead to the inability to use simple-expression evaluation, and he saw no straightforward further optimization #2.
- After a two-month gap, Pavel rebased the proposal twice for current development changes #3 #4.
- Tom Lane reviewed the code and requested nullable ResourceOwner arguments, an extensible and documented SPI execution API, removal of extra exception-handling and owner-allocation overhead for ordinary functions, a clearer helper placement, and correction of a duplicate planning call #5.
- Pavel incorporated those requests by moving owner management into existing handler cleanup and limiting allocation to non-atomic execution, reporting unchanged atomic performance and a smaller remaining slowdown #6.
- Pavel then restricted allocation to routines containing CALL, followed by a correction covering DO and removing an invalid assertion, reporting that the worst-case overhead was nearly eliminated #7 #8.
- Tom committed the final submission as ee895a655c, retaining its ownership design while expanding execution options, removing private SPI snapshot access, and reusing the existing resource owner for inline blocks #8 #9.
- At the thread's close, the CALL optimization had landed; Tom announced a further SPI interface cleanup and Pavel thanked him, with no additional patch or substantive review posted #9 #10.
- Later that day, Tom implemented the announced cleanup in d5a83d79c9, introducing SPI_execute_extended and SPI_cursor_parse_open with extensible option structs, completing the follow-up proposed in #9.