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

CollectionScan stage triggers redundant cursor next() call when minRecord==maxRecord

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL

      CollectionScan stage is also used for finding documents by _id for clustered collections. In this case the CollectionScan stage is used by setting parameters minRecord and maxRecord of the stage to _id. When the looked up document does not exist, then the stage typically calls seekNear() and next() on the cursor. However, in this scenario, the next() call is redundant. This next() call can be very expensive when the storage engine needs to examine deleted entries that reside between the record returned by seekNear() and the record returned by next().

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            mindaugas.malinauskas@mongodb.com Mindaugas Malinauskas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: