-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query Planning
-
None
-
Query Optimization
james.wahlin@mongodb.com brought up a good point: the SBE plan cache aims to prevent the cost of query recompilation even for queries that have just a single possible QuerySolution. Historically for the classic plan cache, queries which specified a hint were ineligible for plan caching. I'm guessing this was because 1) the initial implementation of the classic plan cache wouldn't have worked correctly for queries with a hint, and 2) it didn't matter anyway since the main purpose of the classic plan cache was to avoid multi-planning. In contrast, this could actually make a difference for SBE due to the relatively higher cost of query compilation.
The work for this ticket is to cache queries with a hint in the SBE plan cache. I would recommend that we leave the classic plan cache as is, so that the change applies only to the SBE plan cache. My guess is that this should more or less work out of the box as long as we are careful to start encoding the hint into the SBE plan cache key.
- duplicates
-
SERVER-72803 Cache hinted SBE queries
- Closed