Skip to main content

LogicalPlan

Struct LogicalPlan 

Source
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

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for LogicalPlan

Source§

fn clone(&self) -> Self

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 LogicalPlan

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for LogicalPlan

§

impl Freeze for LogicalPlan

§

impl Move for LogicalPlan

§

impl RefUnwindSafe for LogicalPlan

§

impl Send for LogicalPlan
where RawVecInner: Send, BoxRaw<Clause>: Send, Arc<str>: Send, BoxRaw<Expr>: Send, BoxRaw<LabelExpr>: Send, Arc<Vec<Value>>: Send, Arc<BTreeMap<String, Value>>: Send, Arc<Node>: Send, Arc<Relationship>: Send, Arc<Path>: Send, NonZero<i32>: Send, BoxRaw<CivilZonedFields>: Send, Arc<[f32]>: Send, Arc<[f64]>: Send, Arc<[i64]>: Send, Arc<[u8]>: Send, BoxRaw<TypeExpr>: Send, BoxRaw<Query>: Send, BoxRaw<SearchClause>: Send, BoxRaw<LogicalPlan>: Send, NodeRef<Owned, (usize, usize), MatchStrategy, LeafOrInternal>: Send, BoxRaw<((usize, usize), MatchStrategy)>: Send,

§

impl Sync for LogicalPlan
where RawVecInner: Sync, BoxRaw<Clause>: Sync, Arc<str>: Sync, BoxRaw<Expr>: Sync, BoxRaw<LabelExpr>: Sync, Arc<Vec<Value>>: Sync, Arc<BTreeMap<String, Value>>: Sync, Arc<Node>: Sync, Arc<Relationship>: Sync, Arc<Path>: Sync, NonZero<i32>: Sync, BoxRaw<CivilZonedFields>: Sync, Arc<[f32]>: Sync, Arc<[f64]>: Sync, Arc<[i64]>: Sync, Arc<[u8]>: Sync, BoxRaw<TypeExpr>: Sync, BoxRaw<Query>: Sync, BoxRaw<SearchClause>: Sync, BoxRaw<LogicalPlan>: Sync, NodeRef<Owned, (usize, usize), MatchStrategy, LeafOrInternal>: Sync, BoxRaw<((usize, usize), MatchStrategy)>: Sync,

§

impl Unpin for LogicalPlan

§

impl UnsafeUnpin for LogicalPlan

§

impl UnwindSafe for LogicalPlan

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

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

fn try_from(value: U) -> Result<T, !>

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.