summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/sbe_plan_cache.h
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-18 17:02:53 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-18 17:02:53 -0300
commit959575a5ca598bf5f37fb5cebe7ed1d80d3d71f7 (patch)
treeacc8d60aedb12b70048e676e8a7349deb0010db8 /src/mongo/db/query/sbe_plan_cache.h
parent76588293975fc059cf076779e4283e6ffaf8afff (diff)
New upstream version 6.0.20upstream
Diffstat (limited to 'src/mongo/db/query/sbe_plan_cache.h')
-rw-r--r--src/mongo/db/query/sbe_plan_cache.h9
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;
}
};