[SERVER-67786] CollectionScan stage triggers redundant cursor next() call when minRecord==maxRecord Created: 05/Jul/22  Updated: 05/Dec/22  Resolved: 06/Jul/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Mindaugas Malinauskas Assignee: Backlog - Query Execution
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-62988 Investigate avoiding an extra documen... Backlog
Related
is related to SERVER-66462 Change stream pre-image write perform... Closed
Assigned Teams:
Query Execution
Operating System: ALL
Participants:

 Description   

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().



 Comments   
Comment by Louis Williams [ 06/Jul/22 ]

mindaugas.malinauskas@mongodb.com is this a duplicate of SERVER-62988?

Generated at Thu Feb 08 06:09:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.