model-writtenrun 1680 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Rowley proposed pruning provably empty set-operation inputs in #1, reporting a particularly large EXCEPT ALL speedup and better distinct-row estimates when only one UNION input survives.
- Tom Lane questioned the maintenance cost of special deduplication for EXCEPT with an empty right input in #2, and David removed that case while splitting UNION from EXCEPT/INTERSECT in #3.
- Zhang Mingli requested explicit UNION ALL coverage in #4, but David explained in #8 that avoiding ordinary UNION ALL flattening would complicate the test without exercising additional code.
- Tom challenged the SubqueryScanPath handling added to is_dummy_rel() in #5; David instead propagated dummy status in build_setop_child_paths() in #6, which Tom accepted in #7.
- David committed the UNION portion of #6 as 03d40e4b52, with only a comment wording change beyond rebasing, leaving EXCEPT/INTERSECT pending.
- While working on the remainder, David discovered that using a dummy set operation's first child targetlist broke sorting, and #9 paired a corrective patch with the remaining EXCEPT/INTERSECT optimization.
- Tom warned about the wider implications of replacing the varno-zero convention in #10; David considered SETOP_VAR in #11, then explained in #12 that he retained the existing convention and repaired dummy Result Vars in setrefs.c because a proper RTE redesign exceeded the bugfix's scope.
- The targetlist correction from #9 landed as 928df067d1 with expanded explanatory text, and Tom agreed in #13 that additional RTEs remained a possible long-term solution.
- The EXCEPT/INTERSECT portion of #9 landed as 9c9d41af4d with minor comment edits, while EXCEPT without ALL and an empty right input deliberately retained ordinary planning.
- Alexander Lakhin reported a mixed UNION/UNION ALL failure in #14; Richard Guo diagnosed reuse of the same relation and a freed subpath in #15, and David independently traced it to omitted dummy-child relids in #16.
- David supplied a minimal correction in #17, and Richard independently submitted equivalent logic with updated EXPLAIN output in #18; fdda78e361 credits David and matches Richard's later attachment apart from commentary.
- David explained in #19 that he omitted a dedicated regression query for the freed-path failure because reproducing it depended on an obscure interaction with disabled sequential scans.
- Alexander found another mixed-set-operation failure in #20, and David explained in #21 that single-child UNION estimation was passing an EXCEPT targetlist containing varno-zero Vars to estimate_num_groups().
- David's fix in #22 preserved improved estimates for ordinary surviving children while falling back to the existing conservative estimate for upper relations; it landed as eaa159632d with an expanded commit description.
- David confirmed the final push in #23, leaving all submitted optimization and bugfix work landed, with the broader set-operation RTE redesign discussed in #12 and #13 still deferred.