-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The join plan cache key now includes query settings: SERVER-137120, which follows the same approach as the classic planner. Queries with the same shape but different settings that don't affect the plan selection (comment, maxTimeMS) get different cache entries, since the hash function and equality check on JoinPlanCacheKey are not aligned. These entries hold equivalent plans, so we store duplicates and may replan equivalent queries.
Empty and unset queryKnobs may also produce equivalent plans, but they are keyed differently because of the current equality operator. Same with unset reject and false reject.
Proposed fix: discard settings that don't affect plan selection from the cache key, maybe using one of:
- Normalize settings in the JoinPlanCacheKey constructor by dropping comment and maxTimeMS, and treating empty knobs the same as unset knobs.
- Rewrite operator== to compare only the settings that are hashed, so that equality and hashing agree.
- related to
-
SERVER-137120 Encode query settings into join plan cache key
-
- Closed
-