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
Expand
Expand from a source variable along edges of given type.
Fields
source: Box<LogicalPlan>Input plan.
direction: RelDirectionEdge traversal direction.
temporal_filter: Option<TemporalFilterPlan>Optional temporal validity filter for edges.
Filter
Filter rows by a predicate expression.
Project
Project specific expressions (RETURN clause).
Sort
Sort rows (ORDER BY).
Skip
Skip N rows.
Limit
Limit to N rows.
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).
DeleteOp
Delete nodes/edges.
Fields
source: Box<LogicalPlan>Input plan.
exprs: Vec<Expression>Expressions identifying entities to delete.
SetOp
Set properties.
RemoveOp
Remove properties/labels.
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.
Unwind
UNWIND clause: flatten a list into rows.
OptionalExpand
OPTIONAL MATCH expand: left join semantics. If no matching edges found, emit one record with NULL for new variables.
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).
EmptySource
Empty source (produces one empty row).
CreateIndex
CREATE INDEX DDL operation (node label index).
Fields
CreateEdgeIndex
CREATE EDGE INDEX DDL operation (relationship type index).
Fields
DropIndex
DROP INDEX DDL operation.
VarLengthExpand
Variable-length path expansion (BFS/DFS traversal with depth bounds).
Fields
source: Box<LogicalPlan>Input plan.
direction: RelDirectionEdge traversal direction.
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
lookup_value: ExpressionValue 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: ExpressionTimestamp expression to evaluate.
TemporalRangeScan
BETWEEN TIME query: find all versions within a time range.
Fields
source: Box<LogicalPlan>Input plan.
start_expr: ExpressionStart of the time range.
end_expr: ExpressionEnd of the time range.
SubgraphScan
Scan all subgraph entities. Used when MATCH pattern has label “Subgraph”.
HyperEdgeScan
Scan all hyperedge entities.
CreateHyperedgeOp
Create a hyperedge connecting multiple sources to multiple targets.
Fields
source: Option<Box<LogicalPlan>>Optional input plan.
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
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.
Trait Implementations§
Source§impl Clone for LogicalPlan
impl Clone for LogicalPlan
Source§fn clone(&self) -> LogicalPlan
fn clone(&self) -> LogicalPlan
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more