-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Query Optimization
-
Fully Compatible
-
ALL
-
QO 2023-02-06
Costing a UnionNode is not a commutative operation. It does not use the CE estimate of the first child, but does use every other child's CE estimate. This operation should be commutative in theory.
It looks like the total cost should be startupCost plus child.cost + incrementalCost * child.ce for each child.
Also need to handle the special cast of a union node with one child which is used in its capacity to restrict the projections propagated up to the parent.