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

Mongo Aggregation contains $or operator

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Aggregation Framework
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: