-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
For a lot of the OLTP workloads which we are currently focused on optimizing, we expect that the queries are relatively simple and that they almost always use the plan cache rather than go through full query optimization. For such workloads, the queries are often short-running and therefore overhead on the hot path is significant relative to the time spent doing query execution.
For such queries, we should investigate whether it is possible to consult the plan cache earlier in the code path. For instance, if we wanted to make this change for find commands only, we could measure whether there is an advantage to trying to recover a plan from the plan cache in find_cmd.cpp rather than going through several layers of function calls in get_executor.cpp. As soon as we have a CanonicalQuery we should be able to encode the plan cache key in order to look for a matching plan cache entry.
One complication is that right now we support both the classic and SBE plan caches. As a starting point, perhaps we can only make this change for queries that are identified as sufficiently simple during parsing, and for which we can predict whether the query should use SBE or the Classic Engine. The performance benefits may be different between Classic and SBE, since the set up of steps needed to prepare the plan for execution are very different between the two engines.
- split to
-
SERVER-89011 [v8.0] Remove Bonsai eligibility check from getExecutor() path
- Closed
-
SERVER-89202 Replace std::move of stack-allocated QueryPlannerParams with references/pointers
- Closed
-
SERVER-89203 Refactor PrepareExecutionHelper for faster cached plan execution
- Closed
- links to