Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-8779

$all now choose optimal condition not the first one

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.0
    • Affects Version/s: None
    • Component/s: Server
    • None
    • 0.5

      https://docs.mongodb.com/manual/reference/operator/query/all/#performance

      Queries that use the $all operator must scan all the documents that match the first element in the $all expression. As a result, even with an index to support the query, the operation may be long running, particularly when the first element in the $all expression is not very selective.

      With SERVER-16042 fixed I think it's not the case anymore

            Assignee:
            steve.renaker@mongodb.com Steve Renaker (Inactive)
            Reporter:
            yaoxing.zhang@mongodb.com Yaoxing Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              7 years, 36 weeks, 5 days ago