pub trait LogicalOptimizerRule {
// Required methods
fn try_optimize(
&self,
plan: &LogicalPlan,
) -> QuillSQLResult<Option<LogicalPlan>>;
fn name(&self) -> &str;
// Provided method
fn apply_order(&self) -> Option<ApplyOrder> { ... }
}
Expand description
LogicalOptimizerRule
transforms one LogicalPlan
into another which
computes the same results, but in a potentially more efficient
way. If there are no suitable transformations for the input plan,
the optimizer can simply return it as is.
Required Methods§
Sourcefn try_optimize(
&self,
plan: &LogicalPlan,
) -> QuillSQLResult<Option<LogicalPlan>>
fn try_optimize( &self, plan: &LogicalPlan, ) -> QuillSQLResult<Option<LogicalPlan>>
Try and rewrite plan
to an optimized form, returning None if the plan cannot be
optimized by this rule.
Provided Methods§
Sourcefn apply_order(&self) -> Option<ApplyOrder>
fn apply_order(&self) -> Option<ApplyOrder>
How should the rule be applied by the optimizer
If a rule use default None, it should traverse recursively plan inside itself