model-writtenrun 4718 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tender Wang reported that a query returning five rows on PostgreSQL 12.12 returned none on development HEAD, whose plan incorrectly applied a constant-false filter to the entire result #1.
- Richard Guo reduced the failure to nested joins and traced it to pushing a variable-free qual across outer joins that could commute; his first patch propagated a below_outer_join flag to preserve the qual's syntactic scope #2 #3.
- Richard then proposed using the existing JoinDomain identity instead of adding a flag, retaining full-domain placement only in the top-level domain #4.
- Tom Lane initially favored always using syntactic scope, explaining that dummy-relation bookkeeping could propagate emptiness, and demonstrated a related failure involving equivalence-class-derived constant quals that also needed correction #5.
- After finding that always using syntactic scope produced a less efficient plan, Tom adopted Richard's domain check and supplied a broader patch that stripped lower left joins from derived quals' scopes, tightened an equivclass.c argument, and added three regression cases; deeper join-domain redesign remained deferred #6.
- Richard examined the broader patch and proposed skipping outer-join stripping for the top-level domain, where no outside joins can commute with it #7.
- Tom incorporated that exception inside get_join_domain_min_rels(), committed the revised patch from #6 as a75ff55c83, and confirmed that the fix had landed in the thread's final message #8.