-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
In SERVER-90415 we are changing the system so that queries which run in SBE will use the classic plan cache by default. The SBE plan cache will only get used by queries executing in SBE when featureFlagSbeFull is on.
In SERVER-13341 we will start to cache plans with a single QuerySolution in the classic cache for queries which run in classic.
This ticket suggests combining these two improvements. That is, we should improve the code path where queries are running in SBE but using the classic cache to also create a classic cache entry when there is a single QuerySolution. This change was not incorporated into SERVER-13341 because SERVER-13341 and SERVER-90415 were developed independently and concurrently.
We probably don't need to backport this improvement to 8.0. In 8.0, only queries involving $group/$lookup that tend to be longer running will execute in SBE. The longer overall query runtime largely masks the cost of plan preparation. This improvement would make plan preparation slightly cheaper by avoiding a call to QueryPlanner::plan(). However, this code path will still have to invoke the heavy-weight SBE stage builders, so the savings from skipping QueryPlanner::plan() may not be significant relative to the overall query runtime. Furthermore, this improvement might not be necessary at all if we never try to use the classic plan cache for short-running queries in SBE.
- is related to
-
SERVER-13341 Cache single solution query plans
- Backlog
-
SERVER-90415 Disable SBE plan cache in favor of classic cache
- Closed