pub struct Optimizer { /* private fields */ }Expand description
Multi-pass rule-based optimizer.
Passes are applied left-to-right in the order they were registered. The
default pipeline is constructed by Optimizer::new.
Implementations§
Source§impl Optimizer
impl Optimizer
Sourcepub fn new() -> Self
pub fn new() -> Self
Build the default five-pass optimizer pipeline.
The ProjectionPruning pass is created with an empty required set,
which means it operates as a no-op unless a caller explicitly builds an
optimizer with a non-empty requirement list via Optimizer::with_passes.
Sourcepub fn with_passes(passes: Vec<Box<dyn OptPass>>) -> Self
pub fn with_passes(passes: Vec<Box<dyn OptPass>>) -> Self
Build an optimizer with a custom ordered list of passes.
Sourcepub fn optimize(&self, plan: LogicalPlan) -> LogicalPlan
pub fn optimize(&self, plan: LogicalPlan) -> LogicalPlan
Run all registered passes over plan in registration order.
Source§impl Optimizer
impl Optimizer
Sourcepub fn with_cost_model(model: CostModel) -> Self
pub fn with_cost_model(model: CostModel) -> Self
Create an Optimizer with the standard pipeline plus cost-aware passes.
Cost-aware passes (such as JoinReorder) own an Arc<CostModel> and
require this constructor to be registered. Currently this returns the
same five-pass pipeline as Optimizer::new; cost-aware passes will
attach themselves here as they are added in subsequent phases.