Skip to main content

Module optimizer

Module optimizer 

Source
Expand description

Rule-based SQL query optimizer for LogicalPlan.

The optimizer applies a configurable sequence of rewrite passes to a LogicalPlan tree. Each pass implements OptPass and is applied in order. The default pipeline (built by Optimizer::new) includes:

  1. PredicatePushdown — push filters toward leaf scans
  2. ProjectionPruning — trim projections to the required column set
  3. ConstantFolding — evaluate literal expressions at compile time
  4. LimitPushThrough — push LIMIT N into single-table scans
  5. JoinAlgorithmPass — annotate Join nodes with an algorithm hint

Re-exports§

pub use join_algo::JoinAlgoHint;
pub use join_algo::JoinAlgorithmPass;

Modules§

join_algo
Pass 5: Join algorithm selection.

Structs§

ConstantFolding
Evaluate constant expressions in Filter predicates at compile time.
LimitPushThrough
Push a Limit node down into a single-table Scan.
Optimizer
Multi-pass rule-based optimizer.
PredicatePushdown
Push Filter nodes toward leaf Scan nodes.
ProjectionPruning
Prune Project column lists to only those columns required by the parent.

Traits§

OptPass
A single optimizer rewrite rule.

Functions§

optimize
Run all five default optimizer passes over plan.