[SERVER-16051] Exec stages do not need to call documentNeedsFetch() for non-yielding plans Created: 10/Nov/14  Updated: 21/Oct/15  Resolved: 21/Oct/15

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

Type: Improvement Priority: Minor - P4
Reporter: David Storch Assignee: David Storch
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-15541 Re-enable yielding Closed
Participants:

 Description   

Currently there are four stages which ask the storage engine whether a document is likely in memory, and if not request a yield by returning NEED_FETCH:

  • CollectionScan
  • IDHackStage
  • FetchStage
  • MultiIteratorStage

These stages have no knowledge of the plan's yield policy, and must call documentNeedsFetch() even for plans that will never yield. Any NEED_FETCH requests from these stages for a non-yielding plan will simply be ignored. We can avoid this overhead by passing a flag to any stage which might return NEED_FETCH, and ensure that the stage only can request a yield when the flag is set.


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