model-writtenrun 3882 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Zuming Jiang reported a fuzz-generated outer-join and EXCEPT ALL query that failed with a missing relation entry in #1, and Vik Fearing identified the affected version as 17devel and bisected the failure to self-join removal in #2.
- While investigating, Tom Lane discovered that UniqueRelInfo was stored in a node list without being a Node and that its documentation was stale #3; Alexander Korotkov corrected the structure and comments in 2b26a69455, without posting an attached patch.
- Andrei Lepikhov and Alexander Korotkov traced the original error to distinct parent and child copies of the subquery, only one of which reflected self-join removal #6 #7 #8.
- Andrei preferred preventing Query copying during outer-join reduction over separately cleaning the parent's tree, and attached a flag-based implementation in #9.
- Richard Guo proposed the narrower alternative of passing subroot->parse->targetList to estimate_num_groups() in #10; Andrei combined that correction with his shared-Query approach and identity assertions in #13.
- After objections invoking the existing warning about processed_tlist, Alexander polished Andrei's patch but removed Richard's group-estimation change in #17; Andrei had already pointed out that parse->targetList and processed_tlist are different structures in #16.
- Tom Lane questioned the safety of changing tree-mutation behavior #18, while Richard demonstrated that his narrower fix handled nested set operations and warned that maintaining Query identity imposed a fragile new planner constraint #19 #20 #23.
- Andrei accepted the rationale for using the transformed child query #24, and Richard clarified why its target list should accompany its PlannerInfo and supplied a reduced reproducer #25 #26.
- Alexander explored a third approach that retained removed relation IDs as aliases in #28, but Andrei considered it substantial additional work and recommended postponing both aliases and tree synchronization in favor of Richard's immediate fix #29.
- Alexander recognized that Richard's proposal used parse->targetList rather than processed_tlist #30, then posted the narrow hotfix with explanatory comments and a regression test, leaving shared parse trees and relation aliases for separate discussions #31.
- Andrei approved the hotfix in #32, and ec63622c03 applied #31 unchanged apart from comment whitespace, crediting Richard and Alexander as authors.
- Richard subsequently found that the UniqueRelInfo conversion still left its node tag uninitialized and supplied the makeNode() correction in #33; Alexander applied it unchanged as 93c85db3b5 and confirmed the push in the thread's final message #34.
- At the end of the supplied discussion, the immediate group-estimation and UniqueRelInfo fixes had landed, while shared parse trees and relation aliases remained deferred design questions #31 #32 #34.
- Months later, 9d36b883bf cited the original report #1 while disabling unsafe window run-condition optimizations for nonconstant count(expr) and ntile() arguments in older branches; no matching attachment or implementation review appears in this thread snapshot.