model-writtenrun 2768 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- The thread began with Tom Lane's announcement of a fix that left pulled-up lateral references unmarked by outer joins, avoiding unnecessary PlaceHolderVars and costly nested-loop plans while acknowledging uncertainty about nested outer joins #1.
- Richard Guo supplied a nested-outer-join query that still failed with wrong varnullingrels, showing that lateral references must retain some outer-join markings #2, then submitted a fix based on the lowest nullable side that also avoided unnecessary PlaceHolderVar wrapping #4.
- Tom Lane argued for calculating nullingrels separately for each lateral relation and keeping optimization changes out of a backpatched bug fix #5; his replacement patch computes per-relation nulling information at the start of each lateral subquery pull-up #6.
- Richard Guo approved the replacement and explained how its new information could simplify his separate wrapping optimization #7, while Tom Lane noted that the reusable structure might also support future changes to subquery eligibility checks #8.
- Tom Lane committed #6 as e032e4c7dd with expanded comments and regression tests, backpatching through PostgreSQL 16 and leaving additional optimization for a later development-branch patch.
- After the fix landed, Andrei Lepikhov raised a separate correlated-subquery performance case and asked about alternatives to nested loops #9; Tom Lane explained the need to pass outer-row values into lateral references and questioned the old plan's correctness, leaving that broader planning question unresolved at the thread's end #10.