pub struct Optimizer { /* private fields */ }Expand description
Rule-based optimizer for Krishiv logical plans.
Rules are applied in the order they were added. Each rule receives the plan
produced by the previous rule. If a rule does not change the plan it should
return the input unchanged; the optimizer detects changes via PartialEq
and only records a rule in OptimizeResult::applied_rules when it
actually modifies the plan.
Implementations§
Source§impl Optimizer
impl Optimizer
Sourcepub fn add_rule(&mut self, rule: Box<dyn OptimizerRule>)
pub fn add_rule(&mut self, rule: Box<dyn OptimizerRule>)
Append a rule to the optimizer pipeline.
Sourcepub fn optimize(&self, plan: LogicalPlan) -> OptimizerResult<OptimizeResult>
pub fn optimize(&self, plan: LogicalPlan) -> OptimizerResult<OptimizeResult>
Run all rules in order and return the final plan together with the list of rules that produced a visible change.
P2.4: rules signal no-change by returning None, avoiding an O(rules ×
plan_size) clone-per-rule cycle.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Optimizer
impl !UnwindSafe for Optimizer
impl Freeze for Optimizer
impl Send for Optimizer
impl Sync for Optimizer
impl Unpin for Optimizer
impl UnsafeUnpin for Optimizer
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
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request