pub struct CardinalityEstimator { /* private fields */ }Expand description
Cardinality estimator.
Implementations§
Source§impl CardinalityEstimator
impl CardinalityEstimator
Sourcepub fn with_selectivity_config(config: SelectivityConfig) -> Self
pub fn with_selectivity_config(config: SelectivityConfig) -> Self
Creates a new cardinality estimator with custom selectivity configuration.
Sourcepub fn selectivity_config(&self) -> &SelectivityConfig
pub fn selectivity_config(&self) -> &SelectivityConfig
Returns the current selectivity configuration.
Sourcepub fn create_estimation_log() -> EstimationLog
pub fn create_estimation_log() -> EstimationLog
Creates an estimation log with the default re-planning threshold (10x).
Sourcepub fn from_statistics(stats: &Statistics) -> Self
pub fn from_statistics(stats: &Statistics) -> Self
Creates a cardinality estimator pre-populated from store statistics.
Maps LabelStatistics to TableStats and computes the average edge
fanout from EdgeTypeStatistics. Falls back to defaults for any
missing statistics.
Sourcepub fn add_table_stats(&mut self, name: &str, stats: TableStats)
pub fn add_table_stats(&mut self, name: &str, stats: TableStats)
Adds statistics for a table/label.
Sourcepub fn set_avg_fanout(&mut self, fanout: f64)
pub fn set_avg_fanout(&mut self, fanout: f64)
Sets the average edge fanout.
Sourcepub fn estimate(&self, op: &LogicalOperator) -> f64
pub fn estimate(&self, op: &LogicalOperator) -> f64
Estimates the cardinality of a logical operator.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CardinalityEstimator
impl RefUnwindSafe for CardinalityEstimator
impl Send for CardinalityEstimator
impl Sync for CardinalityEstimator
impl Unpin for CardinalityEstimator
impl UnsafeUnpin for CardinalityEstimator
impl UnwindSafe for CardinalityEstimator
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 more