model-writtenrun 218 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Jul - Oct 2026 ยท 30 entries
- Tom Lane traced bug #19560 to join removal losing a WHERE condition after an EquivalenceClass became a base restriction, and proposed editing the jointree and rebuilding derived planner state in #1.
- Tender Wang supported addressing the maintenance problem and highlighted interactions between successive removal opportunities in #2; Richard Guo then supplied an outer-join-only prototype in #3.
- Tom expanded the prototype into outer-join removal, self-join elimination and semijoin reduction, separating initialization changes and dead-code deletion for review in #4.
- Thom Brown found that self-join elimination left qualifiers outside their jointree scope and reported substantially worse planning performance for many self-joins in #5.
- Tom added qualifier hoisting in #7, which Jacob Brazeal and Thom successfully tested in #8 and #10, then added an outer-join safety assertion, another test and batched self-join removal in #12.
- Richard raised duplicate-filter cleanup and the breadth of the relid-removal walk in #14, but Tom kept redundant-filter optimization outside this bug fix because it was not specific to join elimination and could add planner overhead in #15 and #18.
- Tom prepared squashed per-branch patches in #16, proposing to retain unused external functions on released branches and rename remove_useless_joins so incompatible extension calls would fail clearly.
- Richard questioned result-relid initialization, semijoin scope checks and unchecked invalid relids in #20; after a gap, Tom returned with assertion failures caused by stale subquery trees in #21.
- Richard identified removed subquery RTEs as the stale-tree source and supplied a cleanup delta in #22, while Tom retained ChangeVarNodes and added an explicit INVALID_VAR mode with assertions in #25.
- Richard measured a substantial dependent-join-chain planning slowdown in #23, but he and Tom rejected rebuilding attr_needed in another place because the extra complexity would undermine the maintenance and backpatching goals in #24 and #26.
- Richard's final review deltas corrected semijoin checks and found stale RLS securityQuals in #27 and #28; Tom and Richard agreed to initialize result-relid sets in both the normal and trivial-query paths and remove redundant assertions in #29 and #30.
- Tom announced the push in #31, and the supplied representative 986870baa0 contains the older branch's applicable subset of #25 with the final fixes, while 434c12601c separately records the ABI change.
- Tender reported a post-landing crash involving a simplified CASE expression and a stale LATERAL PHV in #32, leading Tom to propose writing the preprocessed expression back into the subquery in #34.
- Richard found that Tom's write-back patch could preprocess SubPlans twice and miss appendrel children, so he moved preprocessing into subquery_planner in #35.
- Tom supplied an alternative that skipped outer-level PHVs in #37, but Richard objected that their contents could escape back to the owning query before parameter replacement in #38.
- Tender's next crash report in #39 exposed redundant antijoin nullability quals that survived in the jointree, and Richard moved their removal into reduce_outer_joins in #40.
- Tom's review in #41 produced the cleaner helpers and comments in #42; after approval and testing in #43 and #44, ad4b80b6f4 landed with expanded regression coverage.
- The remaining PHV discussion established that preprocessing was query-level dependent and must also cover SubLink subqueries, with Tom explaining the correctness risk in #46 and #48 and Richard producing the broader walk in #49.
- Tom approved the broader PHV design while deferring further optimization in #50, and e28cf96e93 landed from #49 with a more precise alias-flattening condition.
- Fujii Masao confirmed two regressions in the PHV landing in #52: nested copies were processed twice, and join-alias expansion could introduce copies after the preprocessing pass.
- Richard's fix in #54 moved preprocessing after alias expansion and stopped descending into copies already being processed; Fujii's additional appendrel case in #55 was diagnosed by Tender and Richard in #56 and #57 and added to the tests.
- Richard independently found an assertion caused by varnosyn still naming a removed join and proposed preserving that valid syntactic reference in #58; Tom requested more visible deparser coverage in #59, which Richard agreed to add in #60.
- Haibo Yan independently reproduced and bisected the alias-generated PHV failure in #61, and Richard confirmed that the pending preprocessing fix covered it in #62.
- The PHV ordering repair landed as bee81f7864 from #54 with the additional appendrel test, and the varnosyn repair landed as a8bb1a7779 from #58 with EXPLAIN VERBOSE coverage.
- Ayush Tiwari found another assertion when build_subplan revisited an already-preprocessed PHV inside an outer aggregate argument and supplied a skipPHVs fix in #65.
- Noah Misch forwarded Yonghwa Lee's report that self-join elimination could discard RLS protections when combining different permission contexts in #66.
- Tom chose matching checkAsUser values over excluding every RLS-protected relation, supplied the implementation in #68, and added tests and rationale in #69.
- Ayush approved the permission-context grouping in #70, and it landed as 37c2bc950c from #69.
- Richard reviewed Ayush's resent aggregate-PHV patch in #73, and 6b858a36dd landed from #72 with comment edits and simplified tests.
- Richard's final confirmation in #74 closes the last pending fix shown in the thread; the reported correctness issues have landed, while duplicate-filter cleanup and further planning optimizations remain deferred.