[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: |
|
||||||||||||||||
| 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? |