Eliminate useless branch of $unionWith

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Say we have a view like the following on collection A:

      [... {$addFields: {s: "A"}}, {$unionWith: {coll: "B", pipeline: [... {$addFields: {s: "B"}}]}}]

      And a predicate {s: "A"}- then we should be able to completely discard the $unionWith. Similarly, if we see {s: "B"}, we should only execute the inner pipeline of the $unionWith on collection "B". If we see {s: "C"}, we should EOF.

              Assignee:
              Unassigned
              Reporter:
              Alya Berciu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: