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

Exec stages do not need to call documentNeedsFetch() for non-yielding plans

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None

      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.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: