aiondb-plan

Plan IR shared by the planner, optimizer and executor. The crate has no logic of its own beyond construction helpers: it defines the LogicalPlan and PhysicalPlan enums, typed expressions, projections, sort keys, DML and Cypher plan nodes, and the distributed-fragment graph types. Every other SQL-pipeline crate depends on these definitions.

cargo

[dependencies]
aiondb-plan = { path = "../aiondb-plan" }

modules

modulepurpose
logicalLogicalPlan enum and SQL lock modes.
physicalPhysicalPlan enum, join types, aggregates, set operations, Cypher physical pipeline.
exprTyped expression tree (TypedExpr, TypedExprKind, ScalarFunction, WindowFunctionKind).
dmlMergePlan, UpdateAssignment, InsertOnConflict, MergeActionPlan, MutationTarget.
commandNon-DML command plans (CommandPlan, PgObjectAction, DiscardTarget, ...).
graphCypher path functions and IndexScanInfo.
metadataPlanNodeId, ResultField (output column descriptor).
vectorVector-search plan (VectorSearchPlan, VectorSearchAlgorithm, VectorSearchSpec, VectorDistanceMetric).
distributedFragment graph (DistributedPhysicalPlan, PlanFragment, ExchangeKind, FragmentEdge, FragmentTarget, FragmentPlacement, FragmentPartitionSpec).
sharedCross-module pieces: ColumnPlan, IndexColumnPlan, ProjectionExpr, ForeignKeyPlan, HNSW options.

key types

example

use aiondb_core::{DataType, Value};
use aiondb_plan::{LogicalPlan, PhysicalPlan, ProjectionExpr, ResultField, TypedExpr};

let lit = TypedExpr::literal(Value::Int(1), DataType::Int, false);
let proj = ProjectionExpr {
    field: ResultField {
        name: "one".to_string(),
        data_type: DataType::Int,
        nullable: false,
    },
    expr: lit,
};

let plan = PhysicalPlan::ProjectOnce {
    outputs: vec![proj],
    filter: None,
    order_by: Vec::new(),
    limit: None,
    offset: None,
};

let _ = plan;
let _ = LogicalPlan::Checkpoint;