pub enum PlanOp {
Show 19 variants
ScanLabel {
var: String,
label: Option<String>,
},
ScanKey {
var: String,
key: Operand,
label: Option<String>,
},
IndexScan {
var: String,
label: Option<String>,
field: String,
value: Operand,
},
LookupProps {
var: String,
props: Vec<(String, Operand)>,
},
Expand {
from: String,
rel_var: Option<String>,
etypes: Vec<String>,
dir: RelDir,
to: String,
to_label: Option<String>,
to_props: Vec<(String, Operand)>,
},
JoinBound {
var: String,
label: Option<String>,
props: Vec<(String, Operand)>,
},
Filter {
expr: Expr,
},
Project {
items: Vec<RetItem>,
},
Distinct,
OrderBy {
items: Vec<OrderItem>,
},
Skip(LimitSkip),
Limit(LimitSkip),
Aggregate {
func: AggFunc,
arg: AggArg,
column: String,
},
GroupAggregate {
keys: Vec<(String, RetItem)>,
aggs: Vec<(AggFunc, AggArg, String)>,
},
VarExpand {
from: String,
rel_var: Option<String>,
etypes: Vec<String>,
dir: RelDir,
to: String,
min: u8,
max: u8,
},
ShortestPath {
from: String,
rel_var: Option<String>,
etypes: Vec<String>,
dir: RelDir,
to: String,
max_hops: u8,
},
With {
items: Vec<RetItem>,
where_expr: Option<Expr>,
order_by: Vec<OrderItem>,
skip: Option<LimitSkip>,
limit: Option<LimitSkip>,
},
Unwind {
expr: UnwindExpr,
alias: String,
},
LeftOuterApply {
inner: Vec<PlanOp>,
optional_vars: Vec<String>,
},
}Expand description
One operator in the logical plan. Patterns compile left-to-right into
scan / join / expand ops; WHERE is a single Filter; then Project,
rewritten OrderBy, Skip, Limit in that order.
Variants§
ScanLabel
Seed rows from all nodes, or those with label.
ScanKey
Point lookup by IdMap key. Emitted when a MATCH node property map is
exactly one equality on field id (mixed maps stay ScanLabel+LookupProps).
IndexScan
Indexed equality lookup: seed rows from nodes of label whose scalar
field equals value. Emitted when a MATCH node property map is exactly
one equality on a non-id field. The executor uses the property index
when (label, field) is declared, else falls back to a scan+filter, so
this op is always correct regardless of whether the index exists.
LookupProps
Retain rows whose var node matches the pattern-map props.
Expand
Expand from from along etype/dir, binding rel_var and to.
Destination label/prop checks ride on this op (to_label / to_props).
If to is already bound in the row, the executor keeps only edges
that land on that bound id (JoinBound semantics inside Expand).
rel_var is always Some after planning: user name or _rN.
Fields
JoinBound
Pattern-start node whose var is already bound: label/prop re-check only.
Filter
Project
Distinct
Deduplicate projected rows (RETURN DISTINCT). Hashed with the same
numeric unify as GroupAggregate. Caps distinct rows at the
intermediate-row budget.
OrderBy
After plan, every item’s target is OrderTarget::Alias(column)
where column is a projected column name. The executor resolves
ORDER BY against the post-Project table only.
Skip(LimitSkip)
Limit(LimitSkip)
Aggregate
Single aggregate over all matched rows (no grouping).
Execution routes to a streaming accumulator path (O(1) memory). The 1 M intermediate-row budget does not apply: the accumulator holds a single running value regardless of how many source rows exist.
Null/non-numeric values in arg are silently skipped for SUM/AVG/MIN/MAX.
Fields
GroupAggregate
Grouped aggregation: one or more group-key items and one or more aggregate functions, computed per distinct group.
The executor streams through all matching rows, computing one
Option<ValueKey> per group-key item; None represents a null value,
and null keys group together (openCypher semantics).
Group count is capped at 1,000,000; exceeding the cap is an error.
ORDER BY / SKIP / LIMIT ops that follow in the plan apply to the
finished group table (sort the groups, then slice). row_bound() always
returns None for plans containing this op so that LIMIT is never pushed
into producers.
Fields
VarExpand
Variable-length path expansion: BFS from from, emitting one row per
(start, end, depth) path found with min ≤ depth ≤ max.
Per-path edge-uniqueness (Cypher relationship isomorphism): a single
path may not reuse the same edge (EdgeRef) twice; node revisits ARE
allowed. rel_var, when present, is bound to a virtual path cell
whose sole accessible property is length (hop count as Int).
Always executes via the staged path regardless of LIMIT. The 1 M intermediate-row budget applies to the output row count.
Fields
ShortestPath
Shortest path between two already-bound nodes via BFS.
Both from and to must be bound in the current row before this op
executes. BFS terminates at the first depth where to is reached.
If to is unreachable within max_hops, zero rows are emitted.
Exactly one row is emitted when a path exists.
rel_var, when present, binds to a virtual path cell; r.length
yields the hop count as Int.
Always executes via the staged path regardless of LIMIT.
With
Non-aggregate WITH: apply filter / order / skip / limit to the current row set without projecting. Node bindings in the row survive as-is so that subsequent MATCH clauses can join against them.
Always executes via the staged path (row_bound returns None for any plan containing this op).
Fields
Unwind
UNWIND: expand each input row into N rows by iterating a list value.
list: UnwindExpr::Lit(v)→ use a literal list.list: UnwindExpr::Prop { var, field }→ resolve the list from a node property.list: UnwindExpr::Var(name)→ look up a scalar binding from a prior WITH.
null / empty list → 0 output rows (openCypher). Non-list → named error at execution time.
Always executes via the staged path (row_bound returns None).
LeftOuterApply
OPTIONAL MATCH: left-outer-join semantics.
For each input row the inner plan is executed in isolation. If the
inner plan produces at least one output row, those rows replace the
input row (inner join semantics for the rows that match). If the inner
plan produces zero rows, the input row survives with every variable
listed in optional_vars set to null (left-outer fallback).
optional_vars lists the variables that are introduced inside the
optional pattern (i.e., the variables that must be nulled when the
pattern fails). Variables that were already bound before the optional
clause are not listed here — they continue to hold their original values
in the null row.
Always executes via the staged path (row_bound returns None).
Trait Implementations§
impl StructuralPartialEq for PlanOp
Auto Trait Implementations§
impl Freeze for PlanOp
impl RefUnwindSafe for PlanOp
impl Send for PlanOp
impl Sync for PlanOp
impl Unpin for PlanOp
impl UnsafeUnpin for PlanOp
impl UnwindSafe for PlanOp
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.