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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • 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
            Reporter:
            David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: