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

Mongo Aggregation contains $or operator

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • ALL

      have a collection

      a,
      b,
      c
      

      and index on a,b

      found that when aggregation contains $or

      $or:[{"a":xx},{"b":xx}]
      

      is very slow,even both of a and b have index.

      1. when query with "a",may need 300ms,
      and the result is 3x larger than query with "b".
      but when query aggregate with

      $or:[{"a":xx},{"b":xx}]
      

      it need 1.5s

            Assignee:
            mark.agarunov Mark Agarunov
            Reporter:
            cnStoneFang stone [X]
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: