Enable $or-pushdown of negation when the parent $elemMatch is not a root

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This is a follow-up from SERVER-125857. Example:

      { x: 5, arr: {$elemMatch: {a: {$ne: 1}, $or: [{b: {$lt: 2}}, {b: {$gt: 3}}]}},} 

      The negation and the $or share the same $elemMatch context, so the or-pushdown would be correct, but it is currently not Implemented when the $elemMatch is not a root expression.

      The limitation applies only to negation predicates, that are tracked specially in plan enumerator. The pushdown of other predicates is not affected by the presence of the sibling {x:5}

            Assignee:
            Unassigned
            Reporter:
            Milena Ivanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: