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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Performance, Querying
    • None
    • Query Execution

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: