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

Mongo Aggregation contains $or operator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Operating System:
      ALL

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: