pub trait OptimizerRule {
    fn try_optimize(
        &self,
        plan: &LogicalPlan,
        config: &dyn OptimizerConfig
    ) -> Result<Option<LogicalPlan>>; fn name(&self) -> &str; fn apply_order(&self) -> Option<ApplyOrder> { ... } }
Expand description

OptimizerRule 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§

source

fn try_optimize(
    &self,
    plan: &LogicalPlan,
    config: &dyn OptimizerConfig
) -> Result<Option<LogicalPlan>>

Try and rewrite plan to an optimized form, returning None if the plan cannot be optimized by this rule.

source

fn name(&self) -> &str

A human readable name for this optimizer rule

Provided Methods§

source

fn apply_order(&self) -> Option<ApplyOrder>

How should the rule be applied by the optimizer? See comments on ApplyOrder for details.

If a rule use default None, its should traverse recursively plan inside itself

Implementors§

source§

impl OptimizerRule for CommonSubexprEliminate

source§

impl OptimizerRule for DecorrelateWhereExists

source§

impl OptimizerRule for DecorrelateWhereIn

source§

impl OptimizerRule for EliminateCrossJoin

Attempt to reorder join tp eliminate cross joins to inner joins. for queries: ‘select … from a, b where a.x = b.y and b.xx = 100;’ ‘select … from a, b where (a.x = b.y and b.xx = 100) or (a.x = b.y and b.xx = 200);’ ‘select … from a, b, c where (a.x = b.y and b.xx = 100 and a.z = c.z) or (a.x = b.y and b.xx = 200 and a.z=c.z);’ For above queries, the join predicate is available in filters and they are moved to join nodes appropriately This fix helps to improve the performance of TPCH Q19. issue#78

source§

impl OptimizerRule for EliminateFilter

source§

impl OptimizerRule for EliminateLimit

source§

impl OptimizerRule for EliminateOuterJoin

Attempt to eliminate outer joins.

source§

impl OptimizerRule for ExtractEquijoinPredicate

source§

impl OptimizerRule for FilterNullJoinKeys

source§

impl OptimizerRule for InlineTableScan

source§

impl OptimizerRule for PropagateEmptyRelation

source§

impl OptimizerRule for PushDownFilter

source§

impl OptimizerRule for PushDownLimit

Push down Limit.

source§

impl OptimizerRule for PushDownProjection

source§

impl OptimizerRule for RewriteDisjunctivePredicate

source§

impl OptimizerRule for ScalarSubqueryToJoin

source§

impl OptimizerRule for SimplifyExpressions

source§

impl OptimizerRule for SingleDistinctToGroupBy

source§

impl OptimizerRule for TypeCoercion

source§

impl OptimizerRule for UnwrapCastInComparison