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

$in queries perform linearly to the length of the input array

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Performance, Querying
    • Labels:
      None
    • Query Execution

      If you do a $in or $nin query and give it a large array as input, then for each document that needs to be checked to see if it matches the query, it compares the value in that document for that field to each element in the input array. It would be much more performant if there was a single check to see if the value in the document is contained in a hash set of the values passed to the $in query.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: