Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-71796

[CQF] Make union cost commutative

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • 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.

            Assignee:
            svilen.mihaylov@mongodb.com Svilen Mihaylov (Inactive)
            Reporter:
            matt.boros@mongodb.com Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: