Expand description
Volcano-model physical operator pipeline.
The pipeline uses an open / next / close iterator protocol with
row-oriented batches so the
engine can expose the operator surface without the arrow-rs build
dependency. The operator trait and operator catalogue defined here are
the execution contract.
§Operator catalogue
scan::TableScan– pulls every row of a logical relation into the pipeline. The relation source is supplied throughscan::RowSource, so the caller decides whether the rows come from the engine’s per-table store, a CTE materialisation, or an FDW.relational::Filter– keeps rows for which the predicate evaluates truthy.relational::Project– emits a new schema by evaluating an expression list against each row.relational::Sort– fully materialises the input, sorts by a list of(expr, descending)keys, and yields the sorted rows in batches.relational::Limit– caps the row count atoffset + limit, skipping the firstoffsetrows.relational::HashAggregate– group-by + aggregate over a blocking input, supportingCOUNT,SUM,AVG,MIN,MAX.relational::Window– partition + order + frame-aware computation ofROW_NUMBER/RANK/DENSE_RANK/LAG/LEAD/NTILEand pure aggregate windows.spill::SpillBuffer– disk-backed row buffer for blocking operators that exceed an in-memory budget.
Re-exports§
pub use row_stream::SQLRowSource;pub use row_stream::SQLRowStream;pub use batch::Batch;pub use batch::OwnedPhysicalRow;pub use batch::PhysicalRow;pub use batch::PhysicalRowView;pub use batch::RowLockOrigin;pub use batch::RowProjectionValue;pub use batch::RowSchemaExecution;pub use batch::DEFAULT_BATCH_SIZE;pub use column_selection::ColumnSelection;pub use columnar_batch::ColumnVector;pub use columnar_batch::ColumnarBatch;pub use distinct::canonical_row_key;pub use distinct::hash_canonical_row;pub use distinct::try_pack_compact_text_pair;pub use distinct::CanonicalRowHashSet;pub use distinct::Distinct;pub use distinct::ExactRowSet;pub use external_sort::ExternalSort;pub use external_sort::EXTERNAL_SORT_MERGE_FAN_IN;pub use join::HashJoin;pub use join::NestedLoopJoin;pub use join_output::JoinOutput;pub use lateral_join::LateralJoin;pub use lateral_join::LateralRows;pub use lateral_join::LateralSource;pub use map_rows::MapRows;pub use physical::order_expression_position;pub use physical::ordering_satisfies;pub use physical::BackwardScanSupport;pub use physical::ExecError;pub use physical::ExecResult;pub use physical::OperatorBatchCursor;pub use physical::PhysicalOperator;pub use physical::PhysicalOrder;pub use physical::PhysicalScanDirection;pub use project_set::PhysicalProjectRows;pub use project_set::PhysicalProjectSet;pub use project_set::PhysicalSetProjector;pub use project_set::ProjectRows;pub use project_set::ProjectSet;pub use project_set::SetProjector;pub use projected_predicate::ProjectedPredicate;pub use projected_row::ProjectedRow;pub use projected_row::ProjectedValueSlot;pub use relational::AggregateExecutor;pub use relational::AggregateKind;pub use relational::AggregateSpec;pub use relational::ExpressionEvaluator;pub use relational::Filter;pub use relational::HashAggregate;pub use relational::Limit;pub use relational::Project;pub use relational::RowPredicate;pub use relational::SetOperation;pub use relational::Sort;pub use relational::SortKey;pub use relational::Window;pub use relational::WindowExecutor;pub use relational::WindowKind;pub use scalar::eval_call_arguments;pub use scalar::eval_constant_scalar_with_control;pub use scalar::eval_generated_scalar_with_control;pub use scalar::eval_scalar;pub use scalar::ScalarEvalContext;pub use scalar::ScalarSubqueryRunner;pub use scalar::SubqueryResult;pub use scan::PhysicalRowIteratorScan;pub use scan::RowIteratorScan;pub use scan::RowSource;pub use scan::TableScan;pub use scope_overlay::ScopeOverlay;pub use scroll_materialize::prepare_backward_scan;pub use scroll_materialize::ScrollMaterialize;pub use set_operation::ExternalSetOperation;pub use spill::IndexedSpill;pub use spill::SpillBuffer;pub use spill_scan::SpillScan;pub use operator_tree::ExecutionStats;pub use operator_tree::OperatorOutput;pub use operator_tree::OperatorTreeDriver;pub use operator_tree::PlanExecutor;pub use parallel::run_parallel;pub use parallel::ParallelExecutor;pub use parallel::DEFAULT_PARALLEL_WORKERS;pub use parallel::MIN_PARALLEL_BRANCHES;
Modules§
- aggregation
- SQL aggregate planning, bounded execution, and finalization.
- batch
- Schema-bound, allocation-light physical rows and batches.
- catalog
- Immutable catalog inputs and runtime catalog projections.
- column_
selection - Schema-only projection used after an expression-producing stage.
- columnar_
batch - Positional, column-oriented batches for public result transfer.
- copy
- Execute COPY byte streams through the ordinary INSERT and SELECT statement paths.
- distinct
- Byte-bounded streaming physical
DISTINCToperator. - external_
sort - Byte-bounded external merge sort.
- functions
- Runtime contracts for scalar, table, and aggregate extensions.
- join
- Physical relational join operators.
- join_
output - Positional output shaping for
JOIN ... USINGandNATURAL JOIN. - lateral_
join - Correlated physical join operator.
- maintenance
- Execute VACUUM target locking, physical rewrites, compaction and statistics refresh.
- map_
rows - Streaming whole-row mapping adapter.
- mutation
- Physical mutation identities, row images, command overlays, and prepared action transport.
- operator_
tree - Physical operator-tree execution and timing.
- parallel
- Rayon-backed parallel split + recombine, plus a branch-level
ParallelExecutorfor independent plan fragments. - physical
- Volcano
PhysicalOperatortrait shared by every operator in this crate. - project_
set - Streaming one-to-many projection (
ProjectSet). - projected_
predicate - Scalar predicates compiled against positional storage projections.
- projected_
row - Borrowed positional rows produced directly by projected storage reads.
- query
- Query execution state and physical plan construction.
- relational
- Relational Volcano operators.
- result
- SQL result formatting,
PostgreSQLtype metadata and bounded columnar cursors. - routines
- PL/pgSQL activation records, control flow, cursor loops, and diagnostics.
- row_
locks - Process-wide logical row locks for
FOR UPDATE/FOR SHARE. - row_
stream - Owned row production with an explicit, fallible cleanup boundary.
- scalar
- Scalar evaluation over the shared SQL IR.
- scan
- Scan operators.
- schema
- Physical schema changes and validation of stored rows.
- scope_
overlay - Positional overlay for a correlated outer query scope.
- scroll_
materialize - Incremental directional materialization for scrollable executor boundaries.
- serializable
- Logical relation and row observations selected by the executing access path.
- set_
operation - Byte-bounded physical SQL set operations.
- spill
- Disk-backed spill buffer for blocking operators (
Sort,HashAggregate,Window). - spill_
scan - Volcano scan over an owned
crate::spill::SpillBuffer. - statement
- SQL statement execution, transaction boundaries, and batch scheduling.
- storage_
errors - Typed transaction and resource diagnostics across execution storage capabilities.
- type_
resolution - SQL-owned type analysis retained at the execution crate’s public API boundary.
- window
- SQL window function evaluation. Window calls that partition and order their rows the same way share one sort, as the functions of one
WindowAggdo, and each sorted partition is evaluated row by row with the frame semantics ofnodeWindowAgg.c.
Structs§
- Builtin
Function Overload - Column
Identity - Structured SQL column identity. A qualifier is metadata, never a prefix encoded into the column name, so quoted names containing
.remain intact. - Resolved
Function Overload - RowSchema
- Immutable column layout shared by an operator and all of its batches.
- Scalar
Order - Scalar
Window Frame - Scalar
Window Spec
Enums§
- Join
Output Source - Source of one visible or hidden join-output identity.
- Projection
Target - Identity assigned to one projection result. SQL columns participate in
ordinary name binding and wildcard expansion; internal attributes are
executor-only
resjunkslots addressed structurally. - Resolved
String Binary Overload - Scalar
Expr - Scalar
Frame Bound
Traits§
Functions§
- assignment_
type_ compatible - Whether
PostgreSQLassignment coercion accepts the declared source and target. Domains use their base type for cast selection and retain constraint checking at the value conversion boundary; array coercion applies element by element. - bind_
type_ introspection - Bind polymorphic type-introspection calls and common-type coercions while the input schema still carries declared SQL types.
- bind_
type_ introspection_ with_ resolver - Bind type-introspection calls with access to catalog-backed function and aggregate overloads.
- builtin_
function_ argument_ targets - Return the declared argument targets selected by PostgreSQL-compatible built-in resolution. Known argument types are retained for polymorphic calls, while fixed signatures and overloaded operators supply the context needed to resolve
unknownarguments. - common_
context_ expression_ type - Resolve an expression participating in
PostgreSQL’s common-type selection. Bare string and NULL literals retain the parser’sunknowntype until the surrounding VALUES, set operation, CASE, or array context selects a concrete type. - common_
type - equality_
operand_ type - foreign_
key_ operand_ type - Resolve the comparison type accepted by a
PostgreSQLforeign key. The referenced key’s operator class makes compatibility directional: an implicit cast from the referencing type to the referenced type is valid, while the reverse cast alone is not. Integer widths, floating widths, character strings, and date/timestamp types additionally have cross-type equality operators in their shared operator families. - scalar_
type - scalar_
type_ with_ resolver - values_
column_ types
Type Aliases§
- Resolved
Checksum Overload - Resolved
Gamma Overload - Resolved
Json Strip Overload - Resolved
Length Overload - Resolved
Md5Overload - Resolved
Reverse Overload - Resolved
Text Bytea Overload - Subquery
Id - Index into the query children owned by the enclosing expression plan.