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

Optimize PlanExecutorSBE in the case that it need not produce any output documents

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution

      The PlanExecutor::getNext() interface permits the caller to iterate the executor without actually asking for any output documents. This is useful either for count commands or count-like aggregate commands in which you need to know how many times the executor advances without actually computing a result set. It could also be used in cases like explain() in which the result set would be discarded.

      At the moment, PlanExecutorSBE is written so that it will always do work to materialize an output Document or BSONObj. For instance, this code converts an SBE object to a Document/BSONObj (a non-trivial operation). We should improve PlanExecutorSBE to skip such operations when the caller is not asking for an output document.

      Note that when we extend the system to execute count commands with SBE, we presumably will construct plans with an output slot that returns the final count in the first place. PlanExecutorSBE would then have to change so that it doesn't assume that there is an output slot returning a document. So we may want to wait to schedule this improvement until we are working on executing count in SBE.

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

              Created:
              Updated: