pub struct AggregationCache { /* private fields */ }Expand description
Cache for precomputed aggregations
Implementations§
Source§impl AggregationCache
impl AggregationCache
Sourcepub fn new() -> AggregationCache
pub fn new() -> AggregationCache
Create a new aggregation cache
Sourcepub fn register_table(&mut self, table: &str, tracked_columns: &[&str])
pub fn register_table(&mut self, table: &str, tracked_columns: &[&str])
Register a table for aggregation tracking
Sourcepub fn count_filtered(&self, table: &str, filter_key: &str) -> Option<u64>
pub fn count_filtered(&self, table: &str, filter_key: &str) -> Option<u64>
Get filtered count (if cached)
Sourcepub fn set_filtered_count(&mut self, table: &str, filter_key: &str, count: u64)
pub fn set_filtered_count(&mut self, table: &str, filter_key: &str, count: u64)
Set a filtered count (precomputed)
Sourcepub fn numeric_agg(&self, table: &str, column: &str) -> Option<&NumericAgg>
pub fn numeric_agg(&self, table: &str, column: &str) -> Option<&NumericAgg>
Get numeric aggregation for a column
Sourcepub fn distinct_count(&self, table: &str, column: &str) -> Option<u64>
pub fn distinct_count(&self, table: &str, column: &str) -> Option<u64>
Get distinct count estimate for a column
Sourcepub fn on_insert(&mut self, table: &str, values: &HashMap<String, AggValue>)
pub fn on_insert(&mut self, table: &str, values: &HashMap<String, AggValue>)
Record an insert operation
Sourcepub fn on_delete(&mut self, table: &str, values: &HashMap<String, AggValue>)
pub fn on_delete(&mut self, table: &str, values: &HashMap<String, AggValue>)
Record a delete operation
Sourcepub fn refresh<I>(&mut self, table: &str, rows: I)
pub fn refresh<I>(&mut self, table: &str, rows: I)
Full refresh for a table (recompute all aggregates)
Sourcepub fn global_count(&self) -> u64
pub fn global_count(&self) -> u64
Get global row count
Sourcepub fn stats(&self) -> AggCacheStats
pub fn stats(&self) -> AggCacheStats
Get statistics summary
Trait Implementations§
Source§impl Default for AggregationCache
impl Default for AggregationCache
Source§fn default() -> AggregationCache
fn default() -> AggregationCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AggregationCache
impl RefUnwindSafe for AggregationCache
impl Send for AggregationCache
impl Sync for AggregationCache
impl Unpin for AggregationCache
impl UnsafeUnpin for AggregationCache
impl UnwindSafe for AggregationCache
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request