pub struct CostBasedOptimizer { /* private fields */ }Expand description
Cost-based query optimizer
Implementations§
Source§impl CostBasedOptimizer
impl CostBasedOptimizer
pub fn new(config: CostModelConfig) -> Self
Sourcepub fn with_token_budget(self, budget: u64, tokens_per_row: f64) -> Self
pub fn with_token_budget(self, budget: u64, tokens_per_row: f64) -> Self
Set token budget for result limiting
Sourcepub fn update_stats(&self, stats: TableStats)
pub fn update_stats(&self, stats: TableStats)
Update table statistics
Sourcepub fn get_stats(&self, table: &str) -> Option<TableStats>
pub fn get_stats(&self, table: &str) -> Option<TableStats>
Get table statistics
Sourcepub fn optimize(
&self,
table: &str,
columns: Vec<String>,
predicate: Option<Predicate>,
order_by: Vec<(String, SortDirection)>,
limit: Option<u64>,
) -> PhysicalPlan
pub fn optimize( &self, table: &str, columns: Vec<String>, predicate: Option<Predicate>, order_by: Vec<(String, SortDirection)>, limit: Option<u64>, ) -> PhysicalPlan
Optimize a SELECT query
Sourcepub fn get_plan_cost(&self, plan: &PhysicalPlan) -> f64
pub fn get_plan_cost(&self, plan: &PhysicalPlan) -> f64
Get estimated cost from a plan
Sourcepub fn explain(&self, plan: &PhysicalPlan) -> String
pub fn explain(&self, plan: &PhysicalPlan) -> String
Generate EXPLAIN output
Auto Trait Implementations§
impl Freeze for CostBasedOptimizer
impl !RefUnwindSafe for CostBasedOptimizer
impl Send for CostBasedOptimizer
impl Sync for CostBasedOptimizer
impl Unpin for CostBasedOptimizer
impl !UnwindSafe for CostBasedOptimizer
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