pub struct CostModel { /* private fields */ }Expand description
Query cost model that estimates relative execution cost of a LogicalPlan.
Missing tables fall back to TableStats::default.
Implementations§
Source§impl CostModel
impl CostModel
Sourcepub fn with_table_stats(self, table: &str, stats: TableStats) -> Self
pub fn with_table_stats(self, table: &str, stats: TableStats) -> Self
Register per-table statistics for a specific table.
Table names are compared case-insensitively.
Sourcepub fn with_cpu_weight(self, w: f64) -> Self
pub fn with_cpu_weight(self, w: f64) -> Self
Override the CPU-cost weight used to compute total_cost.
Sourcepub fn with_filter_selectivity(self, s: f64) -> Self
pub fn with_filter_selectivity(self, s: f64) -> Self
Override the per-predicate filter selectivity (fraction of rows passing).
Sourcepub fn estimate(&self, plan: &LogicalPlan) -> CostEstimate
pub fn estimate(&self, plan: &LogicalPlan) -> CostEstimate
Estimate the cost of executing plan.
Source§impl CostModel
impl CostModel
Sourcepub fn explain_costs(&self, plan: &LogicalPlan) -> NodeCost
pub fn explain_costs(&self, plan: &LogicalPlan) -> NodeCost
Build a NodeCost tree for plan by recursively estimating each node.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CostModel
impl RefUnwindSafe for CostModel
impl Send for CostModel
impl Sync for CostModel
impl Unpin for CostModel
impl UnsafeUnpin for CostModel
impl UnwindSafe for CostModel
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