pub struct QueryStatistics { /* private fields */ }Expand description
Query statistics tracker
Implementations§
Source§impl QueryStatistics
impl QueryStatistics
Sourcepub fn record_scan(&mut self, relation: &str)
pub fn record_scan(&mut self, relation: &str)
Record a scan access to a relation.
Sourcepub fn record_join(&mut self, left: &str, right: &str, selectivity: f64)
pub fn record_join(&mut self, left: &str, right: &str, selectivity: f64)
Record a join execution and its observed selectivity.
Sourcepub fn scan_count(&self, relation: &str) -> u64
pub fn scan_count(&self, relation: &str) -> u64
Return the number of scan accesses for a relation.
Sourcepub fn join_stats(&self, left: &str, right: &str) -> Option<&JoinStats>
pub fn join_stats(&self, left: &str, right: &str) -> Option<&JoinStats>
Look up join statistics for a specific pair of relations.
Sourcepub fn heat(&self, relation: &str) -> u64
pub fn heat(&self, relation: &str) -> u64
Compute the access heat for a relation (scans + 2*join accesses).
Sourcepub fn relations_by_heat(&self) -> Vec<(String, u64)>
pub fn relations_by_heat(&self) -> Vec<(String, u64)>
Return all relations sorted by descending heat.
Trait Implementations§
Source§impl Debug for QueryStatistics
impl Debug for QueryStatistics
Source§impl Default for QueryStatistics
impl Default for QueryStatistics
Source§fn default() -> QueryStatistics
fn default() -> QueryStatistics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for QueryStatistics
impl RefUnwindSafe for QueryStatistics
impl Send for QueryStatistics
impl Sync for QueryStatistics
impl Unpin for QueryStatistics
impl UnsafeUnpin for QueryStatistics
impl UnwindSafe for QueryStatistics
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