Expand description
CTE Results Cache Manager Module
CTE (Common Table Expression) query result caching function. Avoid repeated calculation of same CTE to improve query performance.
§Caching policy
- LRU elimination policy: eliminate the longest unused entries when the cache is full
- Memory budget management: tightly control the upper limit of memory used by the cache
- Intelligent caching decision: decide whether to cache or not based on CTE characteristics
§Applicable scenarios
- Recursive CTEs are referenced multiple times
- Complex subqueries are used multiple times in a single query
- Medium-sized result set (100-10,000 rows)
- CTE is deterministic (no random functions, etc.)
The module was split from the original single cte_cache.rs into focused
submodules:
entry: theCteCacheEntrycache-row typemanager: theCteCacheManagerstore / eviction enginedecision: theCteCacheDecisionMakercache-policy evaluator
Re-exports§
pub use decision::CteCacheDecision;pub use decision::CteCacheDecisionMaker;pub use entry::CteCacheEntry;pub use manager::CteCacheManager;