model-writtenrun 2115 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported a SQLsmith-generated LATERAL query that could not produce a join plan in #1, and Richard Guo reduced it to a case where from_collapse_limit separated relations that have_dangerous_phv() required to be joined together in #2.
- Richard suggested flattening otherwise unsolvable join subproblems in #3, but Tom Lane proposed removing the restriction and evaluating PlaceHolderVar expressions in the nestloop outer input's target list, preserving the executor's simple-Var parameter interface, in #4.
- Tom supplied the initial implementation in #5 and favored limiting it to development because the longstanding bug appeared uncommon and the fix could change plans or introduce regressions; Richard agreed about avoiding backports in #6.
- Richard questioned using the outer input path's required-outer relids and requested stronger test coverage in #6 and #8; Tom accepted the value of an EXPLAIN test in #7 but retained the placement rule because he could not see a counterexample in #9.
- Tom committed #5 as a16ef313f2, preserving its planner implementation while removing the disabled restriction completely and adding the requested EXPLAIN coverage; stable branches were left unchanged.
- Alexander then demonstrated both unassigned nestloop parameters and an unprocessed SubLink reaching execution in #10; Tom acknowledged that the former vindicated Richard's concern and supplied a delta using the join path's required-outer relids in #11.
- Richard confirmed that the delta also fixed a GEQO regression in #12, and Tom extended it in #13 to substitute a preprocessed PHV expression from PlaceHolderInfo rather than redesign PHV preprocessing late in development.
- Tom noted in #13 that duplicate InitPlans remained, with one unused at runtime, and deferred a broader preprocessing redesign rather than add another preprocessing pass.
- Alexander found a remaining nullingrel mismatch in #14; Tom favored computing accurate nullingrels in #15, while Richard explained the failure and offered a narrower PHV-identity matching workaround in #17, after analyzing why the old restriction protected released branches from the SubLink failure in #16.
- Tom rejected the matching workaround as insufficient when no equivalent target-list PHV existed and posted #18, retaining the previous patch and adding exact nullingrel computation; he deferred tightening setrefs.c from NRM_SUBSET to NRM_EQUAL until the next development cycle.
- After Tom proposed moving SubLink repair into parameter identification in #19, Alexander tested both patches and found another missing-variable failure in #20; Tom's consolidated revision in #21 added replacement of references supplied by higher nestloops and moved the SubLink repair as proposed.
- The thread's last message, #21, left the consolidated follow-up awaiting commitment; it subsequently landed as 66e9df9f6e, with a local adjustment to transform the PHV expression directly, completing both candidate changes while leaving the broader preprocessing redesign and stricter nullingrel checks deferred.