pub struct TensorQueryOptimizer {
pub enabled_rules: Vec<OptimizationRule>,
pub total_optimizations: u64,
pub total_cost_saved: u64,
}Expand description
Optimises TensorLogic query plans by repeatedly applying rewriting rules.
Fields§
§enabled_rules: Vec<OptimizationRule>Ordered list of rules to apply during each pass.
total_optimizations: u64Cumulative count of Self::optimize invocations.
total_cost_saved: u64Cumulative cost units saved across all invocations.
Implementations§
Source§impl TensorQueryOptimizer
impl TensorQueryOptimizer
Sourcepub fn new(rules: Vec<OptimizationRule>) -> Self
pub fn new(rules: Vec<OptimizationRule>) -> Self
Create a new optimizer with the given rule set.
Sourcepub fn optimize(&mut self, root: QueryNode) -> (QueryNode, OptimizationResult)
pub fn optimize(&mut self, root: QueryNode) -> (QueryNode, OptimizationResult)
Optimise root, returning the new plan and an OptimizationResult.
Rules are applied in order; the process repeats until the plan is stable or 10 passes have been completed.
Sourcepub fn stats(&self) -> OptimizerStats
pub fn stats(&self) -> OptimizerStats
Return a snapshot of lifetime statistics.
Auto Trait Implementations§
impl Freeze for TensorQueryOptimizer
impl RefUnwindSafe for TensorQueryOptimizer
impl Send for TensorQueryOptimizer
impl Sync for TensorQueryOptimizer
impl Unpin for TensorQueryOptimizer
impl UnsafeUnpin for TensorQueryOptimizer
impl UnwindSafe for TensorQueryOptimizer
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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