Skip to main content

SourceStatistics

Trait SourceStatistics 

Source
pub trait SourceStatistics {
    // Required method
    fn relation_statistics(&self, table: &str) -> Option<RelationStats>;

    // Provided methods
    fn source_access_estimate(
        &self,
        _source: &SourcePlan,
    ) -> Option<LocalAccessEstimate> { ... }
    fn local_access_estimate(
        &self,
        _table: &str,
        _predicate: &ScalarExpr,
    ) -> Option<LocalAccessEstimate> { ... }
}
Expand description

Cardinality and column statistics used to cost base relations during join enumeration. Engines implement this against their live catalogue; callers without a catalogue still get deterministic DPccp enumeration from the optimizer’s fallback cardinality.

Required Methods§

Provided Methods§

Source

fn source_access_estimate( &self, _source: &SourcePlan, ) -> Option<LocalAccessEstimate>

Estimate a non-table source that can participate as one atom in an inner-join region. Returning None keeps that region in SQL order.

Source

fn local_access_estimate( &self, _table: &str, _predicate: &ScalarExpr, ) -> Option<LocalAccessEstimate>

Estimate a predicate that references only table. Returning None delegates to the planner’s scalar selectivity model.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> SourceStatistics for F
where F: Fn(&str) -> Option<RelationStats>,