Skip to main content

LogicalPlan

Enum LogicalPlan 

Source
pub enum LogicalPlan {
Show 28 variants NodeScan { variable: String, label_id: Option<u32>, limit: Option<usize>, }, Expand { source: Box<LogicalPlan>, src_var: String, rel_var: Option<String>, target_var: String, rel_type_id: Option<u32>, direction: RelDirection, temporal_filter: Option<TemporalFilterPlan>, }, Filter { source: Box<LogicalPlan>, predicate: Expression, }, Project { source: Box<LogicalPlan>, items: Vec<ReturnItem>, distinct: bool, }, Sort { source: Box<LogicalPlan>, items: Vec<OrderItem>, }, Skip { source: Box<LogicalPlan>, count: Expression, }, Limit { source: Box<LogicalPlan>, count: Expression, }, Aggregate { source: Box<LogicalPlan>, group_keys: Vec<Expression>, aggregates: Vec<(String, AggregateFunc)>, }, CreateOp { source: Option<Box<LogicalPlan>>, pattern: Pattern, }, DeleteOp { source: Box<LogicalPlan>, exprs: Vec<Expression>, detach: bool, }, SetOp { source: Box<LogicalPlan>, items: Vec<SetItem>, }, RemoveOp { source: Box<LogicalPlan>, items: Vec<RemoveItem>, }, With { source: Box<LogicalPlan>, items: Vec<ReturnItem>, where_clause: Option<Expression>, distinct: bool, }, Unwind { source: Box<LogicalPlan>, expr: Expression, variable: String, }, OptionalExpand { source: Box<LogicalPlan>, src_var: String, rel_var: Option<String>, target_var: String, rel_type_id: Option<u32>, direction: RelDirection, }, MergeOp { source: Option<Box<LogicalPlan>>, pattern: Pattern, on_match: Vec<SetItem>, on_create: Vec<SetItem>, }, EmptySource, CreateIndex { name: Option<String>, label: String, property: String, }, CreateEdgeIndex { name: Option<String>, rel_type: String, property: String, }, DropIndex { name: String, }, VarLengthExpand { source: Box<LogicalPlan>, src_var: String, rel_var: Option<String>, target_var: String, rel_type_id: Option<u32>, direction: RelDirection, min_hops: u32, max_hops: u32, temporal_filter: Option<TemporalFilterPlan>, }, IndexScan { variable: String, label_id: u32, prop_key: String, lookup_value: Expression, }, AsOfScan { source: Box<LogicalPlan>, timestamp_expr: Expression, }, TemporalRangeScan { source: Box<LogicalPlan>, start_expr: Expression, end_expr: Expression, }, SubgraphScan { variable: String, }, HyperEdgeScan { variable: String, }, CreateHyperedgeOp { source: Option<Box<LogicalPlan>>, variable: Option<String>, labels: Vec<String>, sources: Vec<Expression>, targets: Vec<Expression>, }, CreateSnapshotOp { variable: Option<String>, labels: Vec<String>, properties: Option<MapLiteral>, temporal_anchor: Option<Expression>, sub_plan: Box<LogicalPlan>, return_vars: Vec<String>, },
}
Expand description

A logical plan node representing a query execution strategy.

Variants§

§

NodeScan

Scan all nodes, optionally filtered by label ID. If limit is Some, stop after that many nodes (for LIMIT pushdown optimization).

Fields

§variable: String

Variable name to bind matched nodes.

§label_id: Option<u32>

Optional label ID filter.

§limit: Option<usize>

Optional row limit (pushdown optimization).

§

Expand

Expand from a source variable along edges of given type.

Fields

§source: Box<LogicalPlan>

Input plan.

§src_var: String

Source node variable.

§rel_var: Option<String>

Optional relationship variable binding.

§target_var: String

Target node variable.

§rel_type_id: Option<u32>

Optional relationship type ID filter.

§direction: RelDirection

Edge traversal direction.

§temporal_filter: Option<TemporalFilterPlan>

Optional temporal validity filter for edges.

§

Filter

Filter rows by a predicate expression.

Fields

§source: Box<LogicalPlan>

Input plan.

§predicate: Expression

Boolean predicate expression.

§

Project

Project specific expressions (RETURN clause).

Fields

§source: Box<LogicalPlan>

Input plan.

§items: Vec<ReturnItem>

Expressions to project.

§distinct: bool

Whether DISTINCT was specified.

§

Sort

Sort rows (ORDER BY).

Fields

§source: Box<LogicalPlan>

Input plan.

§items: Vec<OrderItem>

Sort keys and directions.

§

Skip

Skip N rows.

Fields

§source: Box<LogicalPlan>

Input plan.

§count: Expression

Number of rows to skip.

§

Limit

Limit to N rows.

Fields

§source: Box<LogicalPlan>

Input plan.

§count: Expression

Maximum number of rows to emit.

§

Aggregate

Aggregate (GROUP BY equivalent via function calls like count).

Fields

§source: Box<LogicalPlan>

Input plan.

§group_keys: Vec<Expression>

Grouping key expressions.

§aggregates: Vec<(String, AggregateFunc)>

Aggregate functions with output column names.

§

CreateOp

Create nodes/edges.

Fields

§source: Option<Box<LogicalPlan>>

Optional input plan (None for standalone CREATE).

§pattern: Pattern

Pattern describing entities to create.

§

DeleteOp

Delete nodes/edges.

Fields

§source: Box<LogicalPlan>

Input plan.

§exprs: Vec<Expression>

Expressions identifying entities to delete.

§detach: bool

Whether DETACH DELETE (also removes relationships).

§

SetOp

Set properties.

Fields

§source: Box<LogicalPlan>

Input plan.

§items: Vec<SetItem>

Property assignments.

§

RemoveOp

Remove properties/labels.

Fields

§source: Box<LogicalPlan>

Input plan.

§items: Vec<RemoveItem>

Items to remove.

§

With

WITH clause: intermediate projection (scope reset).

Fields

§source: Box<LogicalPlan>

Input plan.

§items: Vec<ReturnItem>

Projected items.

§where_clause: Option<Expression>

Optional WHERE filter.

§distinct: bool

Whether DISTINCT was specified.

§

Unwind

UNWIND clause: flatten a list into rows.

Fields

§source: Box<LogicalPlan>

Input plan.

§expr: Expression

List expression to unwind.

§variable: String

Variable name bound to each element.

§

OptionalExpand

OPTIONAL MATCH expand: left join semantics. If no matching edges found, emit one record with NULL for new variables.

Fields

§source: Box<LogicalPlan>

Input plan.

§src_var: String

Source node variable.

§rel_var: Option<String>

Optional relationship variable binding.

§target_var: String

Target node variable.

§rel_type_id: Option<u32>

Optional relationship type ID filter.

§direction: RelDirection

Edge traversal direction.

§

MergeOp

MERGE: match-or-create pattern with optional ON MATCH/ON CREATE SET.

Fields

§source: Option<Box<LogicalPlan>>

Optional input plan (None for standalone MERGE).

§pattern: Pattern

Pattern to match or create.

§on_match: Vec<SetItem>

SET items for ON MATCH.

§on_create: Vec<SetItem>

SET items for ON CREATE.

§

EmptySource

Empty source (produces one empty row).

§

CreateIndex

CREATE INDEX DDL operation (node label index).

Fields

§name: Option<String>

Optional index name.

§label: String

Target label name.

§property: String

Target property name.

§

CreateEdgeIndex

CREATE EDGE INDEX DDL operation (relationship type index).

Fields

§name: Option<String>

Optional index name.

§rel_type: String

Target relationship type name.

§property: String

Target property name.

§

DropIndex

DROP INDEX DDL operation.

Fields

§name: String

Index name to drop.

§

VarLengthExpand

Variable-length path expansion (BFS/DFS traversal with depth bounds).

Fields

§source: Box<LogicalPlan>

Input plan.

§src_var: String

Source node variable.

§rel_var: Option<String>

Optional relationship variable binding.

§target_var: String

Target node variable.

§rel_type_id: Option<u32>

Optional relationship type ID filter.

§direction: RelDirection

Edge traversal direction.

§min_hops: u32

Minimum traversal depth.

§max_hops: u32

Maximum traversal depth.

§temporal_filter: Option<TemporalFilterPlan>

Optional temporal validity filter for edges.

§

IndexScan

Index-based scan: look up nodes by label + property value using an index. The executor checks at runtime whether an index actually exists. If no index is available, falls back to label scan + filter.

Fields

§variable: String

Variable name to bind matched nodes.

§label_id: u32

Label ID for the index lookup.

§prop_key: String

Property key name.

§lookup_value: Expression

Value to look up in the index.

§

AsOfScan

AT TIME query: find node/edge versions at a specific point in time.

Fields

§source: Box<LogicalPlan>

Input plan.

§timestamp_expr: Expression

Timestamp expression to evaluate.

§

TemporalRangeScan

BETWEEN TIME query: find all versions within a time range.

Fields

§source: Box<LogicalPlan>

Input plan.

§start_expr: Expression

Start of the time range.

§end_expr: Expression

End of the time range.

§

SubgraphScan

Scan all subgraph entities. Used when MATCH pattern has label “Subgraph”.

Fields

§variable: String

Variable name to bind matched subgraphs.

§

HyperEdgeScan

Scan all hyperedge entities.

Fields

§variable: String

Variable name to bind matched hyperedges.

§

CreateHyperedgeOp

Create a hyperedge connecting multiple sources to multiple targets.

Fields

§source: Option<Box<LogicalPlan>>

Optional input plan.

§variable: Option<String>

Optional variable binding for the new hyperedge.

§labels: Vec<String>

Labels for the hyperedge.

§sources: Vec<Expression>

Source participant expressions.

§targets: Vec<Expression>

Target participant expressions.

§

CreateSnapshotOp

CREATE SNAPSHOT: execute a sub-query and materialize results into a subgraph.

Fields

§variable: Option<String>

Optional variable binding for the new subgraph.

§labels: Vec<String>

Labels for the subgraph.

§properties: Option<MapLiteral>

Properties to set on the subgraph.

§temporal_anchor: Option<Expression>

Optional temporal anchor expression.

§sub_plan: Box<LogicalPlan>

Inner query plan to execute.

§return_vars: Vec<String>

Variable names to collect from the inner query.

Trait Implementations§

Source§

impl Clone for LogicalPlan

Source§

fn clone(&self) -> LogicalPlan

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for LogicalPlan

Source§

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

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

impl PartialEq for LogicalPlan

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for LogicalPlan

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> 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> 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 = Infallible

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.