pub struct QueryOptimizer { /* private fields */ }Expand description
Query optimizer with cost-based planning
Implementations§
Source§impl QueryOptimizer
impl QueryOptimizer
Sourcepub fn with_cost_model(cost_model: CostModel) -> Self
pub fn with_cost_model(cost_model: CostModel) -> Self
Create with custom cost model
Sourcepub fn update_total_edges(&mut self, count: usize, _source: CardinalitySource)
pub fn update_total_edges(&mut self, count: usize, _source: CardinalitySource)
Update total edge count for cardinality estimation
Sourcepub fn set_cardinality_hint(&mut self, column: &str, hint: CardinalityHint)
pub fn set_cardinality_hint(&mut self, column: &str, hint: CardinalityHint)
Set cardinality hint for a column
Sourcepub fn plan_query(
&self,
predicates: &[QueryPredicate],
limit: Option<usize>,
) -> QueryPlan
pub fn plan_query( &self, predicates: &[QueryPredicate], limit: Option<usize>, ) -> QueryPlan
Plan a query using cost-based index selection
Evaluates each candidate index against a full scan, choosing the cheapest access path based on selectivity × row count.
Sourcepub fn estimate_selectivity(&self, predicate: &QueryPredicate) -> f64
pub fn estimate_selectivity(&self, predicate: &QueryPredicate) -> f64
Estimate selectivity of a predicate
Trait Implementations§
Source§impl Debug for QueryOptimizer
impl Debug for QueryOptimizer
Source§impl Default for QueryOptimizer
impl Default for QueryOptimizer
Source§fn default() -> QueryOptimizer
fn default() -> QueryOptimizer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for QueryOptimizer
impl RefUnwindSafe for QueryOptimizer
impl Send for QueryOptimizer
impl Sync for QueryOptimizer
impl Unpin for QueryOptimizer
impl UnsafeUnpin for QueryOptimizer
impl UnwindSafe for QueryOptimizer
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