Skip to main content

PlanOp

Enum PlanOp 

Source
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.

Fields

§

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).

Fields

§

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.

Fields

§field: String
§value: Operand
§

LookupProps

Retain rows whose var node matches the pattern-map props.

Fields

§props: Vec<(String, Operand)>
§

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

§from: String
§rel_var: Option<String>
§etypes: Vec<String>
§to_label: Option<String>
§to_props: Vec<(String, Operand)>
§

JoinBound

Pattern-start node whose var is already bound: label/prop re-check only.

Fields

§props: Vec<(String, Operand)>
§

Filter

Fields

§expr: Expr
§

Project

Fields

§items: Vec<RetItem>
§

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.

Fields

§

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

§func: AggFunc
§column: String

Projected column name — alias if provided, else the canonical function call string (COUNT(*), SUM(n.age), etc.).

§

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

§keys: Vec<(String, RetItem)>

Non-aggregate RETURN items: (projected_column_name, ret_item).

§aggs: Vec<(AggFunc, AggArg, String)>

Aggregate RETURN items: (func, arg, projected_column_name).

§

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

§from: String
§rel_var: Option<String>
§etypes: Vec<String>
§min: u8
§max: u8
§

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.

Fields

§from: String
§rel_var: Option<String>
§etypes: Vec<String>
§max_hops: u8
§

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

§items: Vec<RetItem>
§where_expr: Option<Expr>
§order_by: Vec<OrderItem>
§

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).

Fields

§alias: String
§

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).

Fields

§inner: Vec<PlanOp>
§optional_vars: Vec<String>

Trait Implementations§

Source§

impl Clone for PlanOp

Source§

fn clone(&self) -> PlanOp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PlanOp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PlanOp

Source§

fn eq(&self, other: &PlanOp) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PlanOp

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.