Skip to main content

Module cte_cache

Module cte_cache 

Source
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

  1. Recursive CTEs are referenced multiple times
  2. Complex subqueries are used multiple times in a single query
  3. Medium-sized result set (100-10,000 rows)
  4. CTE is deterministic (no random functions, etc.)

The module was split from the original single cte_cache.rs into focused submodules:

Re-exports§

pub use decision::CteCacheDecision;
pub use decision::CteCacheDecisionMaker;
pub use entry::CteCacheEntry;
pub use manager::CteCacheManager;

Modules§

decision
entry
manager