pub struct QueryPlanCache { /* private fields */ }Expand description
Query plan cache for avoiding redundant optimization
Implementations§
Source§impl QueryPlanCache
impl QueryPlanCache
Sourcepub fn with_config(config: CachingConfig) -> Self
pub fn with_config(config: CachingConfig) -> Self
Create with custom configuration
Sourcepub fn with_invalidation_coordinator(
config: CachingConfig,
coordinator: Arc<CacheCoordinator>,
) -> Self
pub fn with_invalidation_coordinator( config: CachingConfig, coordinator: Arc<CacheCoordinator>, ) -> Self
Create with invalidation coordinator
Sourcepub fn attach_coordinator(&mut self, coordinator: Arc<CacheCoordinator>)
pub fn attach_coordinator(&mut self, coordinator: Arc<CacheCoordinator>)
Attach invalidation coordinator
Sourcepub fn get(
&self,
query: &str,
params: Vec<String>,
current_stats: &Statistics,
) -> Option<Algebra>
pub fn get( &self, query: &str, params: Vec<String>, current_stats: &Statistics, ) -> Option<Algebra>
Get a cached plan if available
Sourcepub fn insert(
&self,
query: &str,
params: Vec<String>,
plan: Algebra,
estimated_cost: f64,
current_stats: &Statistics,
)
pub fn insert( &self, query: &str, params: Vec<String>, plan: Algebra, estimated_cost: f64, current_stats: &Statistics, )
Cache a query plan
Sourcepub fn invalidate_pattern(&self, pattern: &str)
pub fn invalidate_pattern(&self, pattern: &str)
Invalidate entries that reference a specific pattern
Sourcepub fn mark_invalidated(&self, signature: QuerySignature)
pub fn mark_invalidated(&self, signature: QuerySignature)
Mark entry as invalidated without removing (for batched invalidation)
Sourcepub fn invalidate_signature(&self, signature: &QuerySignature)
pub fn invalidate_signature(&self, signature: &QuerySignature)
Invalidate by signature (for coordinator integration)
Sourcepub fn statistics(&self) -> CacheStats
pub fn statistics(&self) -> CacheStats
Get cache statistics
Sourcepub fn config(&self) -> &CachingConfig
pub fn config(&self) -> &CachingConfig
Get configuration
Sourcepub fn update_config(&mut self, config: CachingConfig)
pub fn update_config(&mut self, config: CachingConfig)
Update configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryPlanCache
impl !RefUnwindSafe for QueryPlanCache
impl Send for QueryPlanCache
impl Sync for QueryPlanCache
impl Unpin for QueryPlanCache
impl UnsafeUnpin for QueryPlanCache
impl !UnwindSafe for QueryPlanCache
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.