pub struct QueryOptimizer { /* private fields */ }Expand description
Query optimizer for backward chaining
Implementations§
Source§impl QueryOptimizer
impl QueryOptimizer
Sourcepub fn with_config(config: OptimizerConfig) -> Self
pub fn with_config(config: OptimizerConfig) -> Self
Create optimizer with custom configuration
Sourcepub fn optimize_goals(&mut self, goals: Vec<Goal>) -> Vec<Goal>
pub fn optimize_goals(&mut self, goals: Vec<Goal>) -> Vec<Goal>
Optimize a list of goals
Returns a reordered list of goals optimized for evaluation
Sourcepub fn estimate_selectivity(&self, goal: &Goal) -> f64
pub fn estimate_selectivity(&self, goal: &Goal) -> f64
Estimate selectivity of a goal (lower = more selective)
Returns a value between 0.0 (very selective) and 1.0 (not selective)
Sourcepub fn set_selectivity(&mut self, predicate: String, selectivity: f64)
pub fn set_selectivity(&mut self, predicate: String, selectivity: f64)
Set selectivity estimate for a predicate
Sourcepub fn stats(&self) -> &OptimizationStats
pub fn stats(&self) -> &OptimizationStats
Get optimization statistics
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset statistics
Sourcepub fn set_reordering(&mut self, enabled: bool)
pub fn set_reordering(&mut self, enabled: bool)
Enable or disable goal reordering
Sourcepub fn set_index_selection(&mut self, enabled: bool)
pub fn set_index_selection(&mut self, enabled: bool)
Enable or disable index selection
Sourcepub fn set_memoization(&mut self, enabled: bool)
pub fn set_memoization(&mut self, enabled: bool)
Enable or disable memoization
Trait Implementations§
Source§impl Clone for QueryOptimizer
impl Clone for QueryOptimizer
Source§fn clone(&self) -> QueryOptimizer
fn clone(&self) -> QueryOptimizer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QueryOptimizer
impl Debug for QueryOptimizer
Auto Trait Implementations§
impl Freeze for QueryOptimizer
impl RefUnwindSafe for QueryOptimizer
impl Send for QueryOptimizer
impl Sync for QueryOptimizer
impl Unpin 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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