diff options
Diffstat (limited to 'src/mongo/db/query/sbe_plan_cache.h')
| -rw-r--r-- | src/mongo/db/query/sbe_plan_cache.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/query/sbe_plan_cache.h b/src/mongo/db/query/sbe_plan_cache.h index 6e7853fa817..090df251bdf 100644 --- a/src/mongo/db/query/sbe_plan_cache.h +++ b/src/mongo/db/query/sbe_plan_cache.h @@ -190,7 +190,14 @@ struct CachedSbePlan { using PlanCacheEntry = PlanCacheEntryBase<CachedSbePlan, plan_cache_debug_info::DebugInfoSBE>; struct BudgetEstimator { - size_t operator()(const std::shared_ptr<const PlanCacheEntry>& entry) { + /** + * This estimator function is called when an entry is added or removed to LRU cache in order to + * make sure the total plan cache size does not exceed the maximum size. + */ + size_t operator()(const sbe::PlanCacheKey& key, + const std::shared_ptr<const PlanCacheEntry>& entry) { + // TODO: SERVER-73649 include size of underlying query shape and size of int_32 key hash in + // total size estimation. return entry->estimatedEntrySizeBytes; } }; |
