Skip to main content

Module plan

Module plan 

Source
Expand description

Complete SQL-to-execution-plan lowering.

OperatorTree is the specialised algebra for posting-list, graph, and fusion operations. It is intentionally not a relational algebra: forcing a SQL window frame or a mutation into a posting-list node would erase its row and command semantics. This module supplies the missing super-plan. Every SQL statement lowers to one UnifiedPlan, while query-producing statements recursively own their relational children. A physical driver can therefore use an OperatorTree as an access path inside a relational node without keeping a second top-level SQL dispatcher.

Modules§

input_projection
Substitute analyzed input expressions without evaluating their values.
locking
Canonical relation row marks selected by SQL locking analysis.
source_projection
Required SQL source columns and explicitly requested relation metadata.
subqueries
Compact scalar-subquery arenas after expression rewrites discard inputs.
windows
Canonical window clauses own analyzed inputs; expanded call specifications are derived copies.

Structs§

AnalyzedSource
Input schemas from one ordered analysis, sharing immutable row metadata. Join children preserve their own namespaces before the join’s aliases and USING projection.
AssignmentPlan
ConflictPlan
CteCyclePlan
Generated cycle mark and path columns for a recursive CTE.
CtePlan
A named query child owned by a QueryPlan.
CteSearchPlan
Generated traversal-order column for a recursive CTE.
DeletePlan
ExecutableMemory
Allocation leases transferred with an executable. The root box is kept separate so projecting an unboxed query releases exactly that allocation, while attached child roots become ordinary tree storage.
ExpressionPlan
Executable scalar IR plus every query-valued descendant it owns.
InsertPlan
MergePlan
MutableCommandPlan
MutableExpressionPlan
MutableJoinParts
MutableJoinShell
MutableQueryPlan
A private query destination with independently owned scalar fields and query children. Observation is read-only; consuming edits transfer or destroy the corresponding constructor records together with their IR.
MutableSourcePlan
A source whose child and scalar constructor records follow consuming edits.
OrderPlan
OwnedDeferredRewriteIter
OwnedExecutablePlan
An executable and the reservations transferred by its allocation owners. Moving an existing input into this owner performs no allocation and does not retroactively charge that input. Native producers must admit their new allocations before transferring them. The tree is read-only after publication; preparation that constructs additional storage must retain its output reservations too.
OwnedProjection
OwnedProjectionIter
OwnedQueryPlan
A relational executable projected from its statement owner. Retaining the original root box avoids copying its payload or releasing a charged box while its reservation is still attached to the query.
OwnedScalarChildren
Moves immediate scalar children in copy order without copying their payloads or allocating a work queue. Unvisited children and the original parent containers remain owned until exhaustion or iterator destruction.
OwnedScalarExpr
A scalar expression whose child allocations can be transferred or discarded independently. The expression is read-only outside this owner’s consuming operations; replacing raw IR through a mutable dereference would separate allocations from their reservations.
OwnedValueRow
ProjectionPlan
QueryBlockPlan
One SELECT block after WITH and set-operation structure has been pulled into explicit parent/child nodes.
QueryPlan
A relational query with its CTE scope and one relational root.
RetainedCtePlan
RetainedQueryArena
RuleValuesInput
The target values and private DEFAULT flags carried by a rewritten VALUES input.
ScalarQueryArena
A private scalar-query namespace. Its syntax and constructor records move together; observers can borrow children while only owning operations can add them.
SharedAnalyzedSource
SharedExecutablePlan
Shared immutable execution storage. Keeping the Arc private prevents unwrapping its payload while leaving the shared allocation’s reservation attached to an unboxed value.
TableFunctionPlan
One independently resolved and bound function inside a range-function group.
UpdatePlan
ViewCheckPlan
ViewRuleInsertPlan
ViewRuleReturningPlan
ViewRuleUpdatePlan

Enums§

AccessPathPlan
Cross-paradigm access decision made after the relational and scalar portions of a query block have both been lowered.
CommandAssignmentSlot
CommandPlan
Non-query statement plans. Mutations own physical sources and scalar IR; query-bearing catalog commands own explicit query children. Typed DDL and procedural payloads contain catalog data, never a second SQL dispatcher.
CommandQuerySlot
CommandScalarSlot
ComputePlan
The SELECT-list phase chosen during lowering.
ConflictActionPlan
CtePlanBody
A relational CTE or a command whose RETURNING relation feeds its consumers.
JoinExecutionStrategy
Physical strategy selected for a relational join.
MergeWhenPlan
MutableExecutablePlan
PlanRef
A statement root borrowed from either a complete plan or a utility’s relational child. Borrowing does not copy the child or assert that its analysis or optimization has run.
ProjectionTarget
Identity assigned to one projection result. SQL columns participate in ordinary name binding and wildcard expansion; internal attributes are executor-only resjunk slots addressed structurally.
QueryChildSlot
A directly retained query child. Each child keeps its own scalar-subquery namespace.
QueryScalarSlot
A scalar root in one query’s own expression namespace. Nested sources and query children retain separate owners.
RelationalPlan
Relational nodes common to ordinary SQL, retrieval SQL, and table/graph functions.
SourceChildSlot
SourcePlan
The row-producing source below a query block.
SourceScalarSlot
UnifiedPlan
One fully lowered SQL statement.

Traits§

AggregateClassifier
Classification hook for engine-registered aggregate functions. Built-in aggregates are always recognised; the callback extends that set without making the planner depend on the engine.
ExecutablePlanOptimizer
Analyze and optimize a logical plan using metadata captured for this call.
OwnedScopedPlanVisitor
ScopedPlanVisitor
Hooks receive the enclosing CTE namespace, using decoded, unqualified names. A command’s own definitions are not enclosing names. Returning false leaves its children unvisited.

Functions§

rewrite_scalar_expression
Visit one scalar-expression tree in post-order and rewrite each node once.

Type Aliases§

ScalarArenaTransform
ScalarNodeTransform