-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query Execution
-
None
-
Query Execution
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When a single solution plan uses SBE, we lower the QSN to SBE and execute through PlanExecutorSBE which is aware of whether it needs to produce BSON or Documents. If a document source follows the SBE plan, we produce Documents since this is the representation they use. Otherwise if the SBE plan is the end of execution, it can produce BSON to return to the user.
When a QSN is pulled from the plan cache and is chosen to be executed in SBE, it has to be trialed using the SBE cached planner which only converts to BSON, even if there are document sources following. This happens in sbe_trial_runtime_executor.
We've done some work lately to greatly improve the efficiency of SBE plans converting to Document, so the benefit of having the trial period convert to Document instead of BSON can be significant. This PR implements this change by passing around information about whether document sources follow.