model-writtenrun 1819 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Wei Sun reported that UNION over varchar columns estimated width 38 despite child scans estimating 11, and demonstrated that a forced hash aggregate outperformed the chosen sort-based plan #1.
- David Rowley traced the estimate to set-operation Vars with varno zero receiving type-default widths, proposed weighting child widths by estimated row counts, and supplied a UNION patch for master only to avoid destabilizing stable-branch plans #2.
- Wei Sun acknowledged the explanation and described using a hint as a temporary workaround, without reporting a review or test of the patch #3.
- David Rowley extended the patch to INTERSECT and EXCEPT through a shared target-building helper, choosing both children's weighted widths for INTERSECT and only the left child's width for EXCEPT because the right child contributes no output rows #4.
- David Rowley considered a special varno mechanism but found it more complex and unclear, then confirmed that #4 had landed with comment refinements as 2cb49c609b; the thread ended with the change committed to master and no backports planned #5.