pub struct FeedbackCache { /* private fields */ }Expand description
Cache for cardinality feedback entries
Implementations§
Source§impl FeedbackCache
impl FeedbackCache
Sourcepub fn with_settings(decay_factor: f64, max_entries: usize) -> Self
pub fn with_settings(decay_factor: f64, max_entries: usize) -> Self
Create a cache with custom settings
Sourcepub fn record_feedback(
&self,
table_name: &str,
predicate_hash: u64,
column_name: Option<String>,
estimated_rows: u64,
actual_rows: u64,
)
pub fn record_feedback( &self, table_name: &str, predicate_hash: u64, column_name: Option<String>, estimated_rows: u64, actual_rows: u64, )
Record cardinality feedback for a predicate
Sourcepub fn lookup(
&self,
table_name: &str,
predicate_hash: u64,
) -> Option<CardinalityFeedback>
pub fn lookup( &self, table_name: &str, predicate_hash: u64, ) -> Option<CardinalityFeedback>
Look up feedback for a predicate pattern
Sourcepub fn get_correction(&self, table_name: &str, predicate_hash: u64) -> f64
pub fn get_correction(&self, table_name: &str, predicate_hash: u64) -> f64
Get correction factor for a predicate, returns 1.0 if no feedback
Sourcepub fn apply_correction(
&self,
table_name: &str,
predicate_hash: u64,
estimate: u64,
) -> u64
pub fn apply_correction( &self, table_name: &str, predicate_hash: u64, estimate: u64, ) -> u64
Apply correction to an estimate
Sourcepub fn invalidate_table(&self, table_name: &str)
pub fn invalidate_table(&self, table_name: &str)
Remove all learned corrections for a table after data or schema change.
Sourcepub fn get_table_feedback(&self, table_name: &str) -> Vec<CardinalityFeedback>
pub fn get_table_feedback(&self, table_name: &str) -> Vec<CardinalityFeedback>
Get all feedback entries for a table
Trait Implementations§
Source§impl Debug for FeedbackCache
impl Debug for FeedbackCache
Auto Trait Implementations§
impl !Freeze for FeedbackCache
impl RefUnwindSafe for FeedbackCache
impl Send for FeedbackCache
impl Sync for FeedbackCache
impl Unpin for FeedbackCache
impl UnsafeUnpin for FeedbackCache
impl UnwindSafe for FeedbackCache
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