model-writtenrun 7547 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Amit Langote proposed lazy ResultRelInfo creation in #1 after benchmarks showed that generic UPDATE plans still initialized every partition's result relation despite runtime pruning, and identified locking, permission-loop, and relation-lookup costs as further bottlenecks.
- David Rowley explained in #3 that inherited children already require no separate permission checks, so the remaining permission overhead came from scanning the entire range table; Amit acknowledged that distinction in #4.
- Amit fixed a postgres_fdw crash in #5 and bundled the inherited-UPDATE planning prerequisites with the otherwise unchanged patches in #7 so reviewers and CI could apply the complete stack.
- Following Daniel Gustafsson's suggestion to decouple the dependencies in #8 and Robert Haas's request for clearer explanations in #9, Amit produced an independent four-patch series in #10, separating conversion-map management; a compiler-warning fix and September rebase followed in #11 and #12.
- After intervening executor-layering discussion, Amit returned with a substantially revised two-patch series in #13, combining lazy result-relation access with a new way for ModifyTable to supply FDW result-relation state.
- Heikki Linnakangas questioned scattered field initialization in #14, prompting Amit to consolidate it into ExecGetResultRelation in #16.
- Heikki proposed moving direct-modify initialization into ForeignNext in #17; Amit adopted that approach in #20 rather than changing FDW callback arguments, then corrected the callback-timing documentation in #23 following #22.
- Heikki identified inconsistent availability of the root-relation pointer in #24, and Amit generalized it in #25 so trigger code could also obtain lazily built child-to-root maps without a ModifyTableState.
- The series survived December and January rebases in #26, #27, and #28, including COPY restructuring and FDW batch insertion; upstream root-relation changes then made a preparatory patch unnecessary in #29.
- Amit adapted the series to the new inherited-UPDATE executor in #31, sharing ModifyTable's result-relation lookup table, and reported substantial generic-plan speedups in #32.
- Tom Lane rejected delayed BeginDirectModify in #33 because remote partitions might start with inconsistent snapshots, recommending that the patch retain only optimizations that preserved execution semantics.
- Amit's replacement in #36 kept whole ResultRelInfos initialized eagerly while delaying individual fields, including new-tuple, RETURNING, and WITH CHECK OPTION expression state, and demonstrated that deferred new-tuple projections contributed substantial savings.
- Tom extracted index, routing, conversion-map, and lookup improvements from #36 into c5b7ba4e67, with local fixes to allocation, lookup-cache handling, and index initialization.
- Tom separately committed lazy INSERT/UPDATE projections from #36 as a1115fa078, splitting the initialization helper and guarding old-tuple-slot initialization in additional execution paths.
- In #37, Tom explained that he had omitted FDW startup reordering because existing FDWs could depend on initialized scans, and omitted lazy RETURNING and WITH CHECK OPTION expressions because their benefit did not yet justify the complexity and missing EXPLAIN subplan concern.
- Amit supplied projection-comment corrections in #39; Tom committed the nodeModifyTable.c portion as 0d46771eaa and explained in #40 why he rejected the proposed execnodes.h restrictions and closed the PostgreSQL 14 commitfest entry.
- Amit clarified in #46 that whole ResultRelInfos were still initialized for every partition and that further deferral required studying foreign-table semantics, alongside the remaining locking and permission-loop overheads.
- The thread ends with #47, where Amit reports cross-partition WITH CHECK OPTION tests and RETURNING benchmarks and resubmits those omitted optimizations; that remainder has no supplied landing commit or subsequent review.