Skip to main content

Module plan

Module plan 

Source
Expand description

Logical plan IR.

Relational-style representation of a query: Scan, Filter, Project, Aggregate, Sort, Limit, Join. Built from a compiled Program by walking method calls on arrays; unrecognised opcode sequences fall through as an opaque Raw node.

The logical plan enables rewrites that are hard to express at the opcode level: e.g. predicate pushdown, filter-then-project reorder, join detection across let bindings.

This is a scaffold — the rewrite rules library is intentionally small.

Structs§

JoinCandidate

Enums§

AggOp
LogicalPlan

Functions§

detect_join_candidates
Walk a LogicalPlan looking for filter predicates that compare two distinct identifiers — a candidate equi-join between correlated scans. Returns a vector of (left-path, right-path) fragment pairs per detected candidate. Wiring actual Join rewrite is future work.
lower
Compile a LogicalPlan back to a flat Program. Inverse of lift. Lifting then lowering should produce a semantically-equivalent program (not necessarily byte-identical — the lowered form is canonicalised).
pushdown_filter
Push a filter down through a project when the project’s map is a pure field-access (equi-projection). Enables evaluating predicate on the larger pre-project rowset, which is often cheaper.