Skip to main content

SqlPlan

Enum SqlPlan 

Source
pub enum SqlPlan {
Show 44 variants ConstantResult { columns: Vec<String>, values: Vec<SqlValue>, }, Scan { collection: String, alias: Option<String>, engine: EngineType, filters: Vec<Filter>, projection: Vec<Projection>, sort_keys: Vec<SortKey>, limit: Option<usize>, offset: usize, distinct: bool, window_functions: Vec<WindowSpec>, temporal: TemporalScope, }, PointGet { collection: String, alias: Option<String>, engine: EngineType, key_column: String, key_value: SqlValue, }, DocumentIndexLookup {
Show 14 fields collection: String, alias: Option<String>, engine: EngineType, field: String, value: SqlValue, filters: Vec<Filter>, projection: Vec<Projection>, sort_keys: Vec<SortKey>, limit: Option<usize>, offset: usize, distinct: bool, window_functions: Vec<WindowSpec>, case_insensitive: bool, temporal: TemporalScope,
}, RangeScan { collection: String, field: String, lower: Option<SqlValue>, upper: Option<SqlValue>, limit: usize, }, Insert { collection: String, engine: EngineType, rows: Vec<Vec<(String, SqlValue)>>, column_defaults: Vec<(String, String)>, if_absent: bool, }, KvInsert { collection: String, entries: Vec<(SqlValue, Vec<(String, SqlValue)>)>, ttl_secs: u64, intent: KvInsertIntent, on_conflict_updates: Vec<(String, SqlExpr)>, }, Upsert { collection: String, engine: EngineType, rows: Vec<Vec<(String, SqlValue)>>, column_defaults: Vec<(String, String)>, on_conflict_updates: Vec<(String, SqlExpr)>, }, InsertSelect { target: String, source: Box<SqlPlan>, limit: usize, }, Update { collection: String, engine: EngineType, assignments: Vec<(String, SqlExpr)>, filters: Vec<Filter>, target_keys: Vec<SqlValue>, returning: bool, }, UpdateFrom { collection: String, engine: EngineType, source: Box<SqlPlan>, target_join_col: String, source_join_col: String, assignments: Vec<(String, SqlExpr)>, target_filters: Vec<Filter>, returning: bool, }, Delete { collection: String, engine: EngineType, filters: Vec<Filter>, target_keys: Vec<SqlValue>, }, Truncate { collection: String, restart_identity: bool, }, Join { left: Box<SqlPlan>, right: Box<SqlPlan>, on: Vec<(String, String)>, join_type: JoinType, condition: Option<SqlExpr>, limit: usize, projection: Vec<Projection>, filters: Vec<Filter>, }, Aggregate { input: Box<SqlPlan>, group_by: Vec<SqlExpr>, aggregates: Vec<AggregateExpr>, having: Vec<Filter>, limit: usize, grouping_sets: Option<Vec<Vec<usize>>>, sort_keys: Vec<SortKey>, }, TimeseriesScan { collection: String, time_range: (i64, i64), bucket_interval_ms: i64, group_by: Vec<String>, aggregates: Vec<AggregateExpr>, filters: Vec<Filter>, projection: Vec<Projection>, gap_fill: String, limit: usize, tiered: bool, temporal: TemporalScope, }, TimeseriesIngest { collection: String, rows: Vec<Vec<(String, SqlValue)>>, }, VectorSearch { collection: String, field: String, query_vector: Vec<f32>, top_k: usize, ef_search: usize, metric: DistanceMetric, filters: Vec<Filter>, array_prefilter: Option<ArrayPrefilter>, ann_options: VectorAnnOptions, skip_payload_fetch: bool, payload_filters: Vec<SqlPayloadAtom>, }, MultiVectorSearch { collection: String, query_vector: Vec<f32>, top_k: usize, ef_search: usize, }, TextSearch { collection: String, query: FtsQuery, top_k: usize, filters: Vec<Filter>, score_alias: Option<String>, }, HybridSearch { collection: String, query_vector: Vec<f32>, query_text: String, top_k: usize, ef_search: usize, vector_weight: f32, fuzzy: bool, score_alias: Option<String>, }, HybridSearchTriple { collection: String, query_vector: Vec<f32>, query_text: String, graph_seed_id: String, graph_depth: usize, graph_edge_label: Option<String>, top_k: usize, ef_search: usize, fuzzy: bool, rrf_k: (f64, f64, f64), score_alias: Option<String>, }, SpatialScan { collection: String, field: String, predicate: SpatialPredicate, query_geometry: Geometry, distance_meters: f64, attribute_filters: Vec<Filter>, limit: usize, projection: Vec<Projection>, }, Union { inputs: Vec<SqlPlan>, distinct: bool, }, Intersect { left: Box<SqlPlan>, right: Box<SqlPlan>, all: bool, }, Except { left: Box<SqlPlan>, right: Box<SqlPlan>, all: bool, }, RecursiveScan { collection: String, base_filters: Vec<Filter>, recursive_filters: Vec<Filter>, join_link: Option<(String, String)>, max_iterations: usize, distinct: bool, limit: usize, }, RecursiveValue { cte_name: String, columns: Vec<String>, init_exprs: Vec<String>, step_exprs: Vec<String>, condition: Option<String>, max_depth: usize, distinct: bool, }, Cte { definitions: Vec<(String, SqlPlan)>, outer: Box<SqlPlan>, }, CreateArray { name: String, dims: Vec<ArrayDimAst>, attrs: Vec<ArrayAttrAst>, tile_extents: Vec<i64>, cell_order: ArrayCellOrderAst, tile_order: ArrayTileOrderAst, prefix_bits: u8, audit_retain_ms: Option<u64>, minimum_audit_retain_ms: Option<u64>, }, DropArray { name: String, if_exists: bool, }, AlterArray { name: String, audit_retain_ms: Option<Option<i64>>, minimum_audit_retain_ms: Option<u64>, }, InsertArray { name: String, rows: Vec<ArrayInsertRow>, }, DeleteArray { name: String, coords: Vec<Vec<ArrayCoordLiteral>>, }, ArraySlice { name: String, slice: ArraySliceAst, attr_projection: Vec<String>, limit: u32, temporal: TemporalScope, }, ArrayProject { name: String, attr_projection: Vec<String>, }, ArrayAgg { name: String, attr: String, reducer: ArrayReducerAst, group_by_dim: Option<String>, temporal: TemporalScope, }, ArrayElementwise { left: String, right: String, op: ArrayBinaryOpAst, attr: String, }, ArrayFlush { name: String, }, ArrayCompact { name: String, }, Merge { target: String, engine: EngineType, source: Box<SqlPlan>, target_join_col: String, source_join_col: String, source_alias: String, clauses: Vec<MergePlanClause>, returning: bool, }, LateralTopK { outer: Box<SqlPlan>, outer_alias: Option<String>, inner_collection: String, inner_filters: Vec<Filter>, inner_order_by: Vec<SortKey>, inner_limit: usize, correlation_keys: Vec<(String, String)>, lateral_alias: String, projection: Vec<Projection>, left_join: bool, }, LateralLoop { outer: Box<SqlPlan>, outer_alias: Option<String>, inner: Box<SqlPlan>, correlation_predicates: Vec<(String, String)>, lateral_alias: String, projection: Vec<Projection>, outer_row_cap: usize, left_join: bool, }, VectorPrimaryInsert { collection: String, field: String, quantization: VectorQuantization, payload_indexes: Vec<(String, PayloadIndexKind)>, rows: Vec<VectorPrimaryRow>, },
}
Expand description

The top-level plan produced by the SQL planner.

Variants§

§

ConstantResult

Query with no FROM clause: SELECT 1, SELECT ‘hello’ AS name, etc. Produces a single row with evaluated constant expressions.

Fields

§columns: Vec<String>
§values: Vec<SqlValue>
§

Scan

Fields

§collection: String
§engine: EngineType
§filters: Vec<Filter>
§projection: Vec<Projection>
§sort_keys: Vec<SortKey>
§limit: Option<usize>
§offset: usize
§distinct: bool
§window_functions: Vec<WindowSpec>
§temporal: TemporalScope

Bitemporal qualifier extracted from FOR SYSTEM_TIME / FOR VALID_TIME. Default when the scan is current-state.

§

PointGet

Fields

§collection: String
§engine: EngineType
§key_column: String
§key_value: SqlValue
§

DocumentIndexLookup

Document fetch via a secondary index: equality predicate on an indexed field. The executor performs an index lookup to resolve matching document IDs, reads each document, and applies any remaining filters, projection, sort, and limit.

Emitted by document_schemaless::plan_scan / document_strict::plan_scan when the WHERE clause contains a single equality predicate on a Ready indexed field. Any additional predicates fall through as post-filters.

Fields

§collection: String
§engine: EngineType
§field: String

Indexed field path used for the lookup.

§value: SqlValue

Equality value from the WHERE clause.

§filters: Vec<Filter>

Remaining filters after extracting the equality used for lookup.

§projection: Vec<Projection>
§sort_keys: Vec<SortKey>
§limit: Option<usize>
§offset: usize
§distinct: bool
§window_functions: Vec<WindowSpec>
§case_insensitive: bool

Whether the chosen index is COLLATE NOCASE — the executor lowercases the lookup value before probing.

§temporal: TemporalScope

Bitemporal qualifier — mirrors Scan::temporal. Document engines must honor it at the Ceiling stage.

§

RangeScan

Fields

§collection: String
§field: String
§limit: usize
§

Insert

Fields

§collection: String
§engine: EngineType
§column_defaults: Vec<(String, String)>

Column defaults from schema: (column_name, default_expr). Used to auto-generate values for missing columns (e.g. id with UUID_V7).

§if_absent: bool

ON CONFLICT DO NOTHING semantics: when true, duplicate-PK rows are silently skipped instead of raising unique_violation. Plain INSERT (no ON CONFLICT clause) sets this to false.

§

KvInsert

KV INSERT: key and value are fundamentally separate. Each entry is (key, value_columns).

Fields

§collection: String
§entries: Vec<(SqlValue, Vec<(String, SqlValue)>)>
§ttl_secs: u64

TTL in seconds (0 = no expiry). Extracted from ttl column if present.

§intent: KvInsertIntent

INSERT-vs-UPSERT distinction. KvOp::Put is a Redis-SET-style upsert by design; to honor SQL INSERT semantics the planner must tell the converter whether a duplicate key should raise (plain INSERT, Insert), be silently skipped (ON CONFLICT DO NOTHING, InsertIfAbsent), or overwrite (UPSERT / ON CONFLICT DO UPDATE, Put).

§on_conflict_updates: Vec<(String, SqlExpr)>

ON CONFLICT (key) DO UPDATE SET field = expr assignments, carried through when intent == Put via the ON-CONFLICT-DO-UPDATE path. Empty for plain UPSERT (whole-value overwrite) and for INSERT variants.

§

Upsert

UPSERT: insert or merge if document exists.

Fields

§collection: String
§engine: EngineType
§column_defaults: Vec<(String, String)>
§on_conflict_updates: Vec<(String, SqlExpr)>

ON CONFLICT (...) DO UPDATE SET field = expr assignments. When empty, upsert is a plain merge: new columns overwrite existing. When non-empty, the engine applies these per-row against the existing document instead of merging the inserted values.

§

InsertSelect

Fields

§target: String
§source: Box<SqlPlan>
§limit: usize
§

Update

Fields

§collection: String
§engine: EngineType
§assignments: Vec<(String, SqlExpr)>
§filters: Vec<Filter>
§target_keys: Vec<SqlValue>
§returning: bool
§

UpdateFrom

UPDATE target SET col = src.col2 FROM src WHERE target.id = src.id

Two-phase execution: scan source with source_filters, then for each matched source row that satisfies the join predicates against a target row, apply assignments (which may reference source columns via qualified names src.col).

join_predicates are equality pairs (target_col, source_col) extracted from the WHERE clause linking the two tables. target_filters are remaining WHERE predicates that reference only target.

Fields

§collection: String
§engine: EngineType
§source: Box<SqlPlan>

The FROM source: a Scan, Join, or other read plan.

§target_join_col: String

Column name used as the target’s join key (e.g. "id").

§source_join_col: String

Column name used as the source’s join key (e.g. "id").

§assignments: Vec<(String, SqlExpr)>

SET assignments — RHS may be SqlExpr::Column { table: Some("src"), .. }.

§target_filters: Vec<Filter>

Filters that apply only to the target collection.

§returning: bool
§

Delete

Fields

§collection: String
§engine: EngineType
§filters: Vec<Filter>
§target_keys: Vec<SqlValue>
§

Truncate

Fields

§collection: String
§restart_identity: bool
§

Join

Fields

§left: Box<SqlPlan>
§right: Box<SqlPlan>
§join_type: JoinType
§condition: Option<SqlExpr>
§limit: usize
§projection: Vec<Projection>

Post-join projection: column names to keep (empty = all columns).

§filters: Vec<Filter>

Post-join filters (from WHERE clause).

§

Aggregate

Fields

§input: Box<SqlPlan>
§group_by: Vec<SqlExpr>
§aggregates: Vec<AggregateExpr>
§having: Vec<Filter>
§limit: usize
§grouping_sets: Option<Vec<Vec<usize>>>

When the GROUP BY contains ROLLUP/CUBE/GROUPING SETS, this field holds the expansion. Each inner Vec<usize> is one grouping set — the indices into group_by (the canonical key list) that are present (non-NULL) for rows in that set. None = plain single-set GROUP BY.

§sort_keys: Vec<SortKey>

ORDER BY applied to the aggregated rows. Empty = no sort (executor returns groups in hash-map iteration order). Populated by apply_order_by when an outer ORDER BY targets a GROUP BY result; the Aggregate executor sorts the finalized group rows before returning.

§

TimeseriesScan

Fields

§collection: String
§time_range: (i64, i64)
§bucket_interval_ms: i64
§group_by: Vec<String>
§aggregates: Vec<AggregateExpr>
§filters: Vec<Filter>
§projection: Vec<Projection>
§gap_fill: String
§limit: usize
§tiered: bool
§temporal: TemporalScope

Bitemporal system-time / valid-time scope. Only non-default on collections created WITH BITEMPORAL; TimeseriesRules::plan_scan rejects temporal scopes otherwise.

§

TimeseriesIngest

Fields

§collection: String
§

VectorSearch

Fields

§collection: String
§field: String
§query_vector: Vec<f32>
§top_k: usize
§ef_search: usize
§metric: DistanceMetric

Distance metric requested by the query operator (<->, <=>, <#>). Overrides the collection-default metric at search time.

§filters: Vec<Filter>
§array_prefilter: Option<ArrayPrefilter>

Optional cross-engine prefilter: when set, the ND-array slice runs first and its output cells’ surrogates form a bitmap that gates the HNSW candidate set. Set by the planner when an ORDER BY vector_distance(...) LIMIT k query is JOINed against ARRAY_SLICE(...). The convert layer lowers this to VectorOp::Search { inline_prefilter_plan: Some(ArrayOp::SurrogateBitmapScan) }.

§ann_options: VectorAnnOptions

ANN knobs parsed from the optional third JSON-string argument to vector_distance(field, query, '{...}').

§skip_payload_fetch: bool

When true, the projection contains only the surrogate/PK column and/or vector_distance(...) — no payload fields. The Data Plane can skip the document-body fetch entirely for vector-primary collections. Always false for non-vector-primary collections (document body is the primary result).

§payload_filters: Vec<SqlPayloadAtom>

Predicates against payload-indexed columns on a vector-primary collection. Each atom is Eq(field, value), In(field, values), or Range(field, ...). The convert layer translates SqlValue → nodedb_types::Value and emits them as VectorOp::Search::payload_filters. The Data Plane intersects the resulting bitmap with the HNSW candidate set via the per-collection PayloadIndexSet::pre_filter.

§

MultiVectorSearch

Fields

§collection: String
§query_vector: Vec<f32>
§top_k: usize
§ef_search: usize
§

TextSearch

Fields

§collection: String
§query: FtsQuery

Structured FTS query. Use FtsQuery::Plain { text, fuzzy } for simple keyword search. FtsQuery::And/Or/Prefix are supported; FtsQuery::Phrase and FtsQuery::Not are represented but rejected by the executor with Unsupported.

§top_k: usize
§filters: Vec<Filter>
§score_alias: Option<String>

When set, the SELECT list contains bm25_score(field, term) and the caller wants a full-collection scan with the score injected under this alias. The converter emits TextOp::BM25ScoreScan instead of TextOp::Search so that all documents — including non-matching ones — appear in the response with null for the score when they do not contain the term.

§

HybridSearch

Fields

§collection: String
§query_vector: Vec<f32>
§query_text: String
§top_k: usize
§ef_search: usize
§vector_weight: f32
§fuzzy: bool
§score_alias: Option<String>

SELECT-list alias the response should use for the RRF score column. None means the executor falls back to the fixed internal field name rrf_score. Set by the planner from the SELECT projection’s AS <alias> for the rrf_score(...) call.

§

HybridSearchTriple

Three-source hybrid search: vector + BM25 text + graph BFS, fused via weighted RRF.

Produced when the planner detects rrf_score(vector_distance(...), bm25_score(...), graph_score(...)) with three source arguments.

Fields

§collection: String
§query_vector: Vec<f32>
§query_text: String
§graph_seed_id: String

Node id used as the BFS seed for the graph leg.

§graph_depth: usize

Maximum BFS depth from the seed node.

§graph_edge_label: Option<String>

Edge label filter for graph BFS. None = all edges.

§top_k: usize
§ef_search: usize
§fuzzy: bool
§rrf_k: (f64, f64, f64)

Per-source RRF k constants: (vector_k, text_k, graph_k).

§score_alias: Option<String>

SELECT-list alias for the fused RRF score column.

§

SpatialScan

Fields

§collection: String
§field: String
§query_geometry: Geometry
§distance_meters: f64
§attribute_filters: Vec<Filter>
§limit: usize
§projection: Vec<Projection>
§

Union

Fields

§inputs: Vec<SqlPlan>
§distinct: bool
§

Intersect

Fields

§left: Box<SqlPlan>
§right: Box<SqlPlan>
§all: bool
§

Except

Fields

§left: Box<SqlPlan>
§right: Box<SqlPlan>
§all: bool
§

RecursiveScan

Fields

§collection: String
§base_filters: Vec<Filter>
§recursive_filters: Vec<Filter>
§join_link: Option<(String, String)>

Equi-join link for tree-traversal recursion: (collection_field, working_table_field). e.g. ("parent_id", "id") means each iteration finds rows where collection.parent_id matches a working_table.id.

§max_iterations: usize
§distinct: bool
§limit: usize
§

RecursiveValue

Value-generating recursive CTE (WITH RECURSIVE name(cols) AS (anchor UNION [ALL] step)).

Unlike RecursiveScan, this variant carries no collection reference — the anchor row is produced entirely from literal expressions and each iteration applies the step expressions to the previous row. The executor evaluates this iteratively in the Data Plane without touching storage.

All expressions are stored as raw SQL text so they can be serialised across the SPSC bridge without requiring SqlExpr to implement Serialize. The executor parses them at execution time via the same lightweight expression evaluator used by the procedural executor.

Fields

§cte_name: String

CTE name (used in error messages).

§columns: Vec<String>

Column names declared on the CTE (e.g. (n) in c(n) AS ...).

§init_exprs: Vec<String>

Anchor SELECT expressions as raw SQL text (one per column).

§step_exprs: Vec<String>

Recursive step SELECT expressions as raw SQL text (one per column). May reference column names from columns.

§condition: Option<String>

Optional WHERE condition as raw SQL text applied to each new row to decide whether to continue. None → run until fixed point.

§max_depth: usize

Maximum iterations before a RecursionDepthExceeded error is raised.

§distinct: bool

false → UNION ALL (keep duplicates); true → UNION (deduplicate).

§

Cte

Non-recursive CTE: execute each definition, then the outer query.

Fields

§definitions: Vec<(String, SqlPlan)>

CTE definitions: (name, subquery_plan).

§outer: Box<SqlPlan>

The outer query that references CTE names.

§

CreateArray

CREATE ARRAY <name> DIMS (...) ATTRS (...) TILE_EXTENTS (...). AST is engine-agnostic — the Origin converter builds the typed nodedb_array::ArraySchema and persists the catalog row.

Fields

§name: String
§tile_extents: Vec<i64>
§prefix_bits: u8

Hilbert-prefix bits for vShard routing (1–16, default 8).

§audit_retain_ms: Option<u64>

Audit-retention horizon in milliseconds. None = non-bitemporal.

§minimum_audit_retain_ms: Option<u64>

Compliance floor for audit_retain_ms. None = no floor.

§

DropArray

DROP ARRAY [IF EXISTS] <name> — pure Control-Plane catalog mutation. Per-core array store cleanup happens lazily.

Fields

§name: String
§if_exists: bool
§

AlterArray

ALTER ARRAY <name> SET (audit_retain_ms = N, ...).

Double-Option semantics for each diff field:

  • None = key was absent from SET clause → field unchanged.
  • Some(None) = key present with value NULL → field set to NULL.
  • Some(Some(v)) = key present with integer value → field set to v.

Fields

§name: String
§audit_retain_ms: Option<Option<i64>>

New value for audit_retain_ms. Some(None) unregisters the array from the bitemporal retention registry.

§minimum_audit_retain_ms: Option<u64>

New value for minimum_audit_retain_ms. Cannot be NULL.

§

InsertArray

INSERT INTO ARRAY <name> COORDS (...) VALUES (...) [, ...].

Fields

§name: String
§

DeleteArray

DELETE FROM ARRAY <name> WHERE COORDS IN ((...), (...)).

Fields

§name: String
§

ArraySlice

SELECT * FROM ARRAY_SLICE(name, {dim:[lo,hi],..}, [attrs], limit).

Fields

§name: String
§attr_projection: Vec<String>

Attribute names. Empty = all attrs.

§limit: u32

0 = unlimited.

§temporal: TemporalScope

Bitemporal qualifier. When both axes are None / Any, the Data Plane returns the live (current) state — the default fast path. Populated from AS OF SYSTEM TIME / AS OF VALID TIME clauses.

§

ArrayProject

SELECT * FROM ARRAY_PROJECT(name, [attrs]).

Fields

§name: String
§attr_projection: Vec<String>

Attribute names. Must be non-empty.

§

ArrayAgg

SELECT * FROM ARRAY_AGG(name, attr, reducer [, group_by_dim]).

Fields

§name: String
§attr: String
§group_by_dim: Option<String>

None = scalar fold; Some(name) = group by that dim.

§temporal: TemporalScope

Bitemporal qualifier. When both axes are None / Any, the Data Plane aggregates against the live (current) state — the default fast path. Populated from AS OF SYSTEM TIME / AS OF VALID TIME.

§

ArrayElementwise

SELECT * FROM ARRAY_ELEMENTWISE(left, right, op, attr).

Fields

§left: String
§right: String
§attr: String
§

ArrayFlush

SELECT ARRAY_FLUSH(name) — returns one row {result: BOOL}.

Fields

§name: String
§

ArrayCompact

SELECT ARRAY_COMPACT(name) — returns one row {result: BOOL}.

Fields

§name: String
§

Merge

MERGE INTO target USING source ON ... WHEN ... THEN ...

Supported only for document_schemaless and document_strict engines. The Data Plane handler evaluates WHEN arms in declaration order and applies the first matching action to each joined or unmatched row.

Fields

§target: String
§engine: EngineType
§source: Box<SqlPlan>

Source plan (Scan, DocumentIndexLookup, or Join of a sub-select).

§target_join_col: String

Column in the target used for the equi-join (from ON clause).

§source_join_col: String

Column in the source used for the equi-join (from ON clause).

§source_alias: String

Alias used to qualify source columns in expressions (e.g. src.col).

§clauses: Vec<MergePlanClause>

WHEN arms in declaration order.

§returning: bool
§

LateralTopK

LATERAL subquery that is equi-correlated and has ORDER BY + LIMIT k.

Emitted when the inner subquery has an equi-key correlation to the outer table plus an ORDER BY ... LIMIT k clause. The Data Plane scans the inner collection once per outer row applying the equi-filter, sorts by inner_order_by, and retains at most inner_limit rows.

correlation_keys is (outer_col, inner_col) — the equi-join pairs that correlate inner to outer.

Fields

§outer: Box<SqlPlan>

Plan producing outer rows.

§outer_alias: Option<String>

Alias used to qualify outer table columns (e.g. "u").

§inner_collection: String

Inner collection to scan.

§inner_filters: Vec<Filter>

Pre-filter applied to inner rows (non-correlated filters).

§inner_order_by: Vec<SortKey>

Sort keys for the inner per-outer-row result.

§inner_limit: usize

Maximum number of inner rows per outer row.

§correlation_keys: Vec<(String, String)>

Equi-join pairs (outer_col, inner_col).

§lateral_alias: String

Alias under which inner rows are presented.

§projection: Vec<Projection>

Post-lateral projection.

§left_join: bool

LEFT join semantics: preserve outer rows even when inner is empty.

§

LateralLoop

General LATERAL subquery — per-outer-row correlated nested loop.

Emitted for LATERAL subqueries that cannot be rewritten as equi-join hash joins or LateralTopK. The Control Plane drives execution: it materialises outer rows, then for each row substitutes the correlation values as additional filters on the inner plan and re-dispatches it.

Bounded by outer_row_cap; queries that exceed the cap receive a typed SqlError::Unsupported before any data is returned.

Fields

§outer: Box<SqlPlan>

Plan producing outer rows.

§outer_alias: Option<String>

Alias used to qualify outer table columns.

§inner: Box<SqlPlan>

Inner subquery plan (correlation predicates are injected at runtime).

§correlation_predicates: Vec<(String, String)>

Correlated predicates extracted from the inner WHERE that reference outer columns. Each entry is (inner_field, outer_field).

§lateral_alias: String

Alias under which inner rows are presented.

§projection: Vec<Projection>

Post-lateral projection.

§outer_row_cap: usize

Maximum outer rows allowed. Queries exceeding this return an error.

§left_join: bool

LEFT join semantics: preserve outer rows even when inner is empty.

§

VectorPrimaryInsert

INSERT into a vector-primary collection.

Emitted by the planner instead of the generic Insert variant when the target collection has primary = PrimaryEngine::Vector. The Data Plane routes each row through VectorOp::DirectUpsert, bypassing full-document MessagePack encoding.

Fields

§collection: String
§field: String

Vector column name (matches VectorPrimaryConfig::vector_field). Plumbed to VectorOp::DirectUpsert so the Data Plane keys its HNSW index by (tid, collection, field) — the same key the SELECT path uses.

§quantization: VectorQuantization

Collection-level quantization. Applied via set_quantization on the first DirectUpsert so subsequent seals trigger codec-dispatch rebuilds against the configured codec.

§payload_indexes: Vec<(String, PayloadIndexKind)>

Payload field names that get equality bitmap indexes. Registered via payload.add_index on the first DirectUpsert.

Trait Implementations§

Source§

impl Clone for SqlPlan

Source§

fn clone(&self) -> SqlPlan

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 SqlPlan

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

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T