Expand description
Query cache for parsed and planned queries.
This module provides an LRU cache for query plans to avoid repeated parsing and optimization of frequently executed queries.
§Cache Levels
- Parsed cache: Caches logical plans after translation (language-specific parsing)
- Optimized cache: Caches logical plans after optimization
§Usage
ⓘ
let cache = QueryCache::new(1000);
// Check cache first
if let Some(plan) = cache.get_optimized(&cache_key) {
return execute(plan);
}
// Parse and optimize
let plan = parse_and_optimize(query)?;
cache.put_optimized(cache_key, plan.clone());
execute(plan)Structs§
- Cache
Key - Cache key combining query text and language.
- Cache
Stats - Cache statistics.
- Caching
Query Processor - A caching wrapper for the query processor.
- Query
Cache - Query cache for parsed and optimized plans.