-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 7.0.0-rc0
-
Component/s: Query Execution
-
None
-
Fully Compatible
-
ALL
This is from code inspection:
MatchExpression:parameterize() (db/matcher/expression.cpp) will revert parameterization of the aggregation $match when there are more than 'maxParameterCount' parameters (512 by default in my investigation), but nothing prevents this plan from being put into the SBE plan cache. Thus if the same query shape occurs again but with different constants, each plan with different constant values will be cached separately, causing cache flooding with large plans that are unlikely ever to be reused.
The fix should be to avoid caching any plan that triggered the reversion of parameterization. (Concurrence from discussion with anna.wawrzyniak@mongodb.com .)
Introduced in 7.0.0-rc0 by SERVER-73589.