-
Type: Task
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
With changes from SERVER-71882, the size of the BSON key and telemetryMetrics value are included in LRUKeyValue memory tracking. However, the size of KVMap, which holds a int_32 hash of the cache keys and pointers to the associated key's position in KVList, should also be included in memory tracking.
LRUKeyValue should maintain its own budge tracker for this overhead cost. It might make sense to replace the estimator from LRUBudgetTracker with a lambda:
template <typename K, typename V> class LRUBudgetTracker { public: LRUBudgetTracker(size_t maxBudget) : _max(maxBudget), _current(0) {} void onAdd(const K& k, const V& v, std::function<size_t(const K&, const V&)> estimator) { _current += estimator(k, v); }
This would call the estimator defined in LRUKeyValue which would have a flag for including overhead size or not in total size. In case of classic plan cache, we only want to know number of entries. We do not care about the size of the keys, size of the plans, or size of overhead. However, we do care about size of overhead for SBE plan cache and telemetry.
- related to
-
SERVER-73649 Improve SBE plan cache BudgetEstimator to incorporate the size of the key
- Closed
-
SERVER-76622 Complete TODO listed in SERVER-73659
- Closed
-
SERVER-76769 Complete TODO listed in SERVER-73659
- Closed
-
SERVER-76574 Improve LRUKeyValue to avoid storing keys twice
- Closed