Skip to main content

PlanNode

Enum PlanNode 

Source
pub enum PlanNode {
Show 29 variants SeqScan { table: String, }, AliasScan { table: String, alias: String, }, IndexScan { table: String, column: String, key: Expr, }, RangeScan { table: String, column: String, start: Option<(Expr, bool)>, end: Option<(Expr, bool)>, }, Filter { input: Box<PlanNode>, predicate: Expr, }, Project { input: Box<PlanNode>, fields: Vec<ProjectField>, }, Sort { input: Box<PlanNode>, keys: Vec<SortKey>, }, Limit { input: Box<PlanNode>, count: Expr, }, Offset { input: Box<PlanNode>, count: Expr, }, Aggregate { input: Box<PlanNode>, function: AggFunc, field: Option<String>, }, NestedLoopJoin { left: Box<PlanNode>, right: Box<PlanNode>, on: Option<Expr>, kind: JoinKind, }, Distinct { input: Box<PlanNode>, }, GroupBy { input: Box<PlanNode>, keys: Vec<String>, aggregates: Vec<GroupAgg>, having: Option<Expr>, }, AlterTable { table: String, action: AlterAction, }, DropTable { name: String, }, Insert { table: String, rows: Vec<Vec<Assignment>>, }, Upsert { table: String, key_column: String, assignments: Vec<Assignment>, on_conflict: Vec<Assignment>, }, Update { input: Box<PlanNode>, table: String, assignments: Vec<Assignment>, }, Delete { input: Box<PlanNode>, table: String, }, CreateTable { name: String, fields: Vec<CreateField>, }, CreateView { name: String, query_text: String, }, RefreshView { name: String, }, DropView { name: String, }, Window { input: Box<PlanNode>, windows: Vec<WindowDef>, }, Union { left: Box<PlanNode>, right: Box<PlanNode>, all: bool, }, Explain { input: Box<PlanNode>, }, Begin, Commit, Rollback,
}
Expand description

Physical plan nodes — what the executor actually runs.

Variants§

§

SeqScan

Fields

§table: String
§

AliasScan

Mission E1.2: sequential scan that renames output columns to alias.field. Used exclusively as the leaves of a join plan so downstream NestedLoopJoin + Filter + Project nodes can resolve Expr::QualifiedField lookups by direct column-name match. Kept separate from SeqScan so the single-table fast paths (which match on PlanNode::SeqScan { .. } in many places) stay untouched.

Fields

§table: String
§alias: String
§

IndexScan

Fields

§table: String
§column: String
§key: Expr
§

RangeScan

B+tree range scan: returns rows where the indexed column falls within the given bounds. Generated by the planner when it detects inequality predicates (>, >=, <, <=, BETWEEN) on an indexed column. The executor falls back to SeqScan+Filter if no index exists on the column.

Fields

§table: String
§column: String
§start: Option<(Expr, bool)>

Lower bound: (expr, inclusive). None = unbounded below.

§end: Option<(Expr, bool)>

Upper bound: (expr, inclusive). None = unbounded above.

§

Filter

Fields

§input: Box<PlanNode>
§predicate: Expr
§

Project

Fields

§input: Box<PlanNode>
§

Sort

Fields

§input: Box<PlanNode>
§keys: Vec<SortKey>
§

Limit

Fields

§input: Box<PlanNode>
§count: Expr
§

Offset

Fields

§input: Box<PlanNode>
§count: Expr
§

Aggregate

Fields

§input: Box<PlanNode>
§function: AggFunc
§

NestedLoopJoin

Mission E1.2: nested-loop join. Correctness-first implementation — O(L × R) scan for every join. E1.3 will add a hash-join fast path for equijoins (the common case). The executor handles Inner, Cross, and LeftOuter; RightOuter is rewritten by the planner into a LeftOuter with swapped inputs.

Fields

§right: Box<PlanNode>
§on: Option<Expr>

Join predicate. None for Cross joins (emit every pair).

§

Distinct

Fields

§input: Box<PlanNode>
§

GroupBy

Mission E2b: grouped aggregation. Output columns are keys ++ [agg.output_name for agg in aggregates]. The optional having predicate is evaluated against each output row after aggregation — it can reference both key columns and aggregate output names (the planner rewrites FunctionCall nodes in the HAVING expression into Field("__agg_N") references).

Fields

§input: Box<PlanNode>
§keys: Vec<String>
§aggregates: Vec<GroupAgg>
§having: Option<Expr>
§

AlterTable

Fields

§table: String
§

DropTable

Fields

§name: String
§

Insert

Fields

§table: String
§rows: Vec<Vec<Assignment>>

One assignment-block per row to insert. Always at least one.

§

Upsert

UPSERT: probe index on key_column — if miss, insert; if hit, update.

Fields

§table: String
§key_column: String
§assignments: Vec<Assignment>
§on_conflict: Vec<Assignment>
§

Update

Fields

§input: Box<PlanNode>
§table: String
§assignments: Vec<Assignment>
§

Delete

Fields

§input: Box<PlanNode>
§table: String
§

CreateTable

Fields

§name: String
§

CreateView

Create a materialized view: execute query, store results, register.

Fields

§name: String
§query_text: String
§

RefreshView

Explicitly refresh a materialized view.

Fields

§name: String
§

DropView

Drop a materialized view (backing table + registry entry).

Fields

§name: String
§

Window

Window function computation layer.

Fields

§input: Box<PlanNode>
§windows: Vec<WindowDef>
§

Union

UNION [ALL]: execute both sides, concatenate (ALL) or deduplicate.

Fields

§right: Box<PlanNode>
§all: bool
§

Explain

EXPLAIN: format the inner plan tree as a text result without executing.

Fields

§input: Box<PlanNode>
§

Begin

§

Commit

§

Rollback

Trait Implementations§

Source§

impl Clone for PlanNode

Source§

fn clone(&self) -> PlanNode

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 PlanNode

Source§

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

Formats the value using the given formatter. Read more

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more