pub struct QueryCache { /* private fields */ }Expand description
Query cache for parsed and optimized plans.
Implementations§
Source§impl QueryCache
impl QueryCache
Sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
Creates a new query cache with the specified capacity.
The capacity is shared between parsed and optimized caches (each gets half the capacity).
Sourcepub fn disabled() -> Self
pub fn disabled() -> Self
Creates a disabled cache (for testing or when caching is not desired).
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns whether caching is enabled.
Sourcepub fn get_parsed(&self, key: &CacheKey) -> Option<LogicalPlan>
pub fn get_parsed(&self, key: &CacheKey) -> Option<LogicalPlan>
Gets a parsed plan from the cache.
Sourcepub fn put_parsed(&self, key: CacheKey, plan: LogicalPlan)
pub fn put_parsed(&self, key: CacheKey, plan: LogicalPlan)
Puts a parsed plan into the cache.
Sourcepub fn get_optimized(&self, key: &CacheKey) -> Option<LogicalPlan>
pub fn get_optimized(&self, key: &CacheKey) -> Option<LogicalPlan>
Gets an optimized plan from the cache.
Sourcepub fn put_optimized(&self, key: CacheKey, plan: LogicalPlan)
pub fn put_optimized(&self, key: CacheKey, plan: LogicalPlan)
Puts an optimized plan into the cache.
Sourcepub fn invalidate(&self, key: &CacheKey)
pub fn invalidate(&self, key: &CacheKey)
Invalidates a specific query from both caches.
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Returns cache statistics.
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Resets hit/miss counters.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for QueryCache
impl !RefUnwindSafe for QueryCache
impl Send for QueryCache
impl Sync for QueryCache
impl Unpin for QueryCache
impl UnwindSafe for QueryCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more