pub struct ColumnStatistics {
pub distinct_count: u64,
pub total_count: u64,
pub null_count: u64,
pub min_value: Option<Value>,
pub max_value: Option<Value>,
pub avg_value: Option<f64>,
pub histogram: Option<Histogram>,
pub most_common: Vec<(Value, f64)>,
}Expand description
Statistics for a column/property.
Fields§
§distinct_count: u64Number of distinct values.
total_count: u64Total number of values (including nulls).
null_count: u64Number of null values.
min_value: Option<Value>Minimum value (if applicable).
max_value: Option<Value>Maximum value (if applicable).
avg_value: Option<f64>Average value (for numeric types).
histogram: Option<Histogram>Equi-depth histogram (for selectivity estimation).
most_common: Vec<(Value, f64)>Most common values with their frequencies.
Implementations§
Source§impl ColumnStatistics
impl ColumnStatistics
Sourcepub fn new(distinct_count: u64, total_count: u64, null_count: u64) -> Self
pub fn new(distinct_count: u64, total_count: u64, null_count: u64) -> Self
Creates new column statistics with basic info.
Sourcepub fn with_min_max(self, min: Value, max: Value) -> Self
pub fn with_min_max(self, min: Value, max: Value) -> Self
Sets min/max values.
Sourcepub fn with_histogram(self, histogram: Histogram) -> Self
pub fn with_histogram(self, histogram: Histogram) -> Self
Sets the histogram.
Sourcepub fn with_most_common(self, values: Vec<(Value, f64)>) -> Self
pub fn with_most_common(self, values: Vec<(Value, f64)>) -> Self
Sets the most common values.
Sourcepub fn null_fraction(&self) -> f64
pub fn null_fraction(&self) -> f64
Returns the null fraction.
Sourcepub fn estimate_equality_selectivity(&self, value: &Value) -> f64
pub fn estimate_equality_selectivity(&self, value: &Value) -> f64
Estimates selectivity for an equality predicate.
Trait Implementations§
Source§impl Clone for ColumnStatistics
impl Clone for ColumnStatistics
Source§fn clone(&self) -> ColumnStatistics
fn clone(&self) -> ColumnStatistics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ColumnStatistics
impl RefUnwindSafe for ColumnStatistics
impl Send for ColumnStatistics
impl Sync for ColumnStatistics
impl Unpin for ColumnStatistics
impl UnwindSafe for ColumnStatistics
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