pub struct LogicalPlan {
pub parts: Vec<Vec<Clause>>,
pub union_all: Vec<bool>,
pub next: Option<Box<LogicalPlan>>,
pub use_target: Option<Namespace>,
pub match_strategies: BTreeMap<(usize, usize), MatchStrategy>,
}Expand description
Logical plan is a pipeline of clauses (plus UNION).
Built by plan, which consumes the lowered Query: the plan owns the
clause vectors moved out of it (no deep clone), so the rewrite pass
mutates them in place.
Fields§
§parts: Vec<Vec<Clause>>§union_all: Vec<bool>§next: Option<Box<LogicalPlan>>§use_target: Option<Namespace>The statement’s resolved USE target (ADR-0116 §3), lifted into the
plan by plan: Some(namespace) when any USE clause is present
(all USE clauses in one statement must agree), None when the
statement carries none and the session namespace applies. Resolution
failures (unknown name 42N00, composite-only selector 42N72, distinct
targets 42NA5, unresolvable element id 42NA7) are plan errors.
Always None on nested NEXT-stage plans; the top-level plan’s
resolution walks the whole statement.
match_strategies: BTreeMap<(usize, usize), MatchStrategy>Planner-selected physical MatchStrategy per (part_idx, clause_idx)
for MATCH clauses in this stage (ADR-0737).
Implementations§
Source§impl LogicalPlan
impl LogicalPlan
Sourcepub fn match_strategy(
&self,
part_idx: usize,
clause_idx: usize,
) -> Option<MatchStrategy>
pub fn match_strategy( &self, part_idx: usize, clause_idx: usize, ) -> Option<MatchStrategy>
Look up the planned MatchStrategy for clause_idx in part_idx of
this stage, if one was selected.
Sourcepub fn single_part(&self) -> Option<&[Clause]>
pub fn single_part(&self) -> Option<&[Clause]>
The plan’s one part, when it has exactly one with no UNION and no
NEXT — the whole-statement shape a fast path requires (a bulk write,
an EXISTS probe, the create-only batch gate). The one home of the
parts/union_all/next test: a UNION arm is a second part and a
NEXT stage is a second plan, so either disqualifies it. Returning
the part keeps the shape test and the right to index parts[0] one
value, so a caller cannot pass the guard and then reach in.
Sourcepub fn is_standalone_call_shape(&self) -> bool
pub fn is_standalone_call_shape(&self) -> bool
Whether the statement has the standalone call shape: the
single_part whole-statement shape holding one
substantive clause (a leading USE routes and does not count:
USE system CALL db.info() is standalone). Any other part — a
UNION arm, a NEXT part, a longer clause list — is in-query. The
plan side’s spelling of the front end’s CallSite::of_statement.