Expand description
Filter Pushdown Optimization Process
The filter pushdown mechanism involves four key steps:
- Optimizer Asks Parent for a Filter Pushdown Plan: The optimizer calls
ExecutionPlan::gather_filters_for_pushdownon the parent node, passing in parent predicates and phase. The parent node creates aFilterDescriptionby inspecting its logic and children’s schemas, determining which filters can be pushed to each child. - Optimizer Executes Pushdown: The optimizer recursively calls
push_down_filtersin this module on each child, passing the appropriate filters (Vec<Arc<dyn PhysicalExpr>>) for that child. - Optimizer Gathers Results: The optimizer collects
FilterPushdownPropagationresults from children, containing information about which filters were successfully pushed down vs. unsupported. - Parent Responds: The optimizer calls
ExecutionPlan::handle_child_pushdown_resulton the parent, passing aChildPushdownResultcontaining the aggregated pushdown outcomes. The parent decides how to handle filters that couldn’t be pushed down (e.g., keep them as FilterExec nodes).
Structs§
- Filter
Pushdown - Attempts to recursively push given filters from the top of the tree into leaves.
- Filtered
Vec 🔒 - A helper structure for filtering elements from a vector through multiple passes while tracking their original indices, allowing results to be mapped back to the original positions.