Skip to main content

Crate relate_executor

Crate relate_executor 

Source

Re-exports§

pub use graph::Graph;
pub use graph::Procedure;
pub use graph::QueryStats;
pub use graph::SnapshotPin;

Structs§

BulkCursor
Cursor into the target space: the next entity index (DELETE) or combination index (row-driven writes) to process.
BulkTargets
The snapshotted target identity space of a BulkWrite (phase 1). Opaque: the only public fact is BulkTargets::total_work.
BulkWrite
A plan-time eligible global bulk write (ADR-0209 §1).
ClauseMetricsRecord
One clause operator’s PROFILE metrics, reported to the sink (ADR-0344 phase 2 + the metric-fields phase): the position key (stage, part, clause) — the same walk the plan tree construction uses — beside the operator’s actuals. Bundled so the sink signature stays at one argument however many metrics a later phase adds.
CsvPolicy
Validated, immutable local-file capability for LOAD CSV (ADR-0081).
DeprecatedBy
A catalog entry’s replacement (CIP-157’s deprecatedBy): the display text SHOW FUNCTIONS/SHOW PROCEDURES render and the replacement’s syntactic form. The form keeps a function/procedure identifier apart from a Cypher clause, so a notification remedy can name each one for what it is instead of guessing from the string.
ExecGraph
Read view of committed graph plus optional overlay (ADR-0016).
ExecRequest
The plan, parameters, source text, and authenticated principal shared by every execution entry point. query_text is the source text of the statement (exposed as SHOW TRANSACTIONS’ currentQuery column); the statement’s CIP-150 version preamble rides on the plan. principal is the connection’s authenticated principal (ADR-0273), read by dbms.showCurrentUser; None reports the documented placeholder. Copy: every field is a reference (or an optional reference) — the commit path reuses the caller’s request with its own batch-commit sink attached, without rebuilding the bundle field by field.
FrontierCounters
The frontier family’s run counters (ADR-0478), one clause’s sum over its per-seed BFS runs: the edge visits (the work the walk budget caps), the completed levels, the accepted endpoints, and the NFA rung’s own PROFILE facts — the (node, state) cells the runs created, the re-arrival work spent, the rule memo’s hits and misses, and the admission asks by verdict. Zero on every clause the frontier declined — levels > 0 is the engagement marker (a run always completes its level 0).
Graph
GraphStats
Construction goes through GraphStats::new (the ADR-0218 one- construction idiom the sibling plan-time stats impls use), so an inline build cannot drift from it.
GraphTypeSpec
The typed, serde-serializable form of a parsed GraphTypeBody (CIP-176/178/180). Graph-type redo ops (RedoOp::PutGraphType / RedoOp::SetCurrentGraphType) carry this model and TheaterData stores it: parsing happens once at DDL-execution time (GraphTypeSpec::from_body), and redo replay converts back with GraphTypeSpec::to_body – an infallible, mechanical conversion, never a re-parse of Cypher text.
InMemoryQueryEngine
Execution plus the in-memory graph and index layout.
IndexDetailSpec
Typed payload of RedoOp::CatalogIndexDetail: the catalog facts of a CREATE INDEX, captured once at DDL-execution time from the parsed clause. apply_redo stores it verbatim – it never formats a CREATE INDEX string and re-parses it.
IndexFacts
One index’s typed facts as every reader resolves them, through the fixed precedence the SHOW INDEXES row and the 00NA0 note share: the index’s IndexDetailSpec, then the owning constraint (a constraint-backed index), then the legacy IndexDef encoding. No reader re-spells the chain, so a new detail field lands in every rendering at once.
PhaseTimes
The clause’s inclusive phase times (LABS-448): the elapsed time spent resolving node candidates (the seek — the store work behind the Nodes kind) and following relationships (the walk — the store work behind the Rels/Degree kinds); the per-candidate admission checks and the arm’s binding/cloning stay unattributed. Inclusive of the nesting a compound operator performs: a walk that triggers nested seeks counts both, like the table’s Total column.
ProcSignature
Static signature and catalog metadata of a built-in procedure.
Procedure
QueryResult
QueryStats
A statement’s mutation counters. Two families count different things:
ReadAdmission
A read admitted at a caller-pinned timestamp: the graph, the pinned snapshot_ts, and the schema captured together with that pin under the publication read guard, plus the request to run and its optional cooperative cancellation token (ADR-0111; None is never cancelled).
SchemaSnapshot
Catalog facts captured alongside an entity pin at read admission. The caller serializes capture with commit publication; execution needs no publication lock and never consults newer named schema.
SnapshotPin
Registered snapshot_ts until drop (ADR-0023 / ADR-0038).
StoreReads
The store-read mix a clause’s arm performed (LABS-369): the kinds the single Db Hits total blends. A Rows=103 operator that spent 300k relationship hops and 0 node reads is a different animal from one that read 103 nodes — the one-glance diagnosis for the scan-turned-traversal family.
WalkStart
How a MATCH walk chose its start element (LABS-369): the fact the opaque Expand hid. A displaced start — a cheap index seek that became a 135k-relationship backward traversal — is named here instead of showing up only as a large Db Hits total.
WriteScratch
Per-attempt write buffer. The shared Graph is not mutated until apply_redo.

Enums§

ContainsCount
Provenance of a plan-time CONTAINS candidate count (LABS-643): the TEXT index stays the one exact measurement, and without one the count comes from a bounded sample scan of the label’s nodes — exact when the label fits inside the sampler’s bound, an extrapolation beyond it. The variant, never a bare number, says which: no consumer can mistake the extrapolation for the measurement, and the sampled form carries the whole-label scan rows the unseekable filter still pays — the floor the compound start estimate (ADR-0474) maxes with the sampled output.
DeprecationForm
The replacement’s syntactic form (the notification remedy’s rendering).
FrontierRunDecline
The frontier rung’s run-time declines (ADR-0516): the reasons a rung that engaged and ran still falls through, typed so the PROFILE record names the one that kept the DFS. The compile-time gates’ own vocabulary (frontier_match::FrontierDecline) stays with the matcher that constructs it — every one of those decides before a single walk, and none rides the record. Lives here — the crate’s lowest shared module — beside the other PROFILE vocabularies (StartReason): the rider wiring records it and the metric record carries it. Two today: the re-arrival budget’s exhaustion (ADR-0516) and the sparse tables’ allocation ceiling (ADR-0521); a later run-time decline adds its variant (and its wire name) here.
IndexKindSpec
The DDL index kind carried by IndexDetailSpec: a serde-serializable mirror of relate_parser::IndexKind.
KernelRung
Which rung served one MATCH clause (LABS-1117): the fact EXPLAIN could not show, because the rungs are runtime choices inside an operator, not plan nodes. The ladder records it per clause; the PROFILE record carries it. Walker is the per-row walker, the rung every decline’s home — the batch scan/filter chain is its own fact (ClauseMetricsRecord::batched), never a rung here.
OntologyOp
Typed view of a store-level ontology document op (ADR-0120 §3), the classification RedoOp::ontology_op returns: Set borrows the verbatim document, Drop carries nothing. Consumers match this once instead of re-matching the redo variants.
PatternEngine
Which pattern engine serves a clause (ADR-0519): a diagnostic-only switch for the pattern-engine spike — never Cypher syntax, no query-level spelling, and no stability promise. It dies with the old engines it switches between.
PullKind
Node vs relationship for RedoOp::PullIdentityPut.
RedoOp
StartReason
The start-selection reason classes (ADR-0350’s bound pivot, ADR-0351’s cheapest-start estimate, the LABS-161 relationship seek, the default).
StatementEffect
What one statement’s execution did to the store: one of exactly three states, never a pair of flags whose fourth combination has to be explained away.

Constants§

DEFAULT_BATCH_BUDGET
Default per-batch work budget (estimated touched entities).
DEFAULT_BATCH_THRESHOLD
Default work estimate at or above which an eligible statement is batched instead of running as one transaction.
MAX_ONTOLOGY_SPEC_BYTES
The ADR-0086 object envelope bounding one ontology document (ADR-0120 §3): 16 MiB, checked before the commit is written.

Traits§

BatchCommit
Per-batch commit sink for CALL { … } IN TRANSACTIONS (ADR-0210). Called by the executor after each successful batch with the batch’s drained redo ops and the snapshot timestamp they were built against; the implementation commits them durably (WAL + apply) before the next batch starts, so live scratch state stays bounded by one batch. Returns the commit timestamp the batch was applied at — the caller rebases its scratch onto it, so only the sink (which owns the commit) ever reads the base graph’s clock.
PlanMetricsSink
Per-clause PROFILE metrics sink (ADR-0344 phase 2): the dispatch loop reports each statement-level clause operator’s metrics once it finishes, keyed (stage, part, clause) — the same walk the plan tree construction uses, so the collected entries stamp onto the PROFILE result’s plan tree without a second mapping.

Functions§

analyze_bulk_write
builtin_function_deprecation
The replacement when name resolves to a deprecated built-in function, None otherwise. One typed lookup over the same table SHOW FUNCTIONS renders, so no caller keeps a second list of deprecated names. A name’s arity rows share one deprecated_by (the lockstep test below), so the first row that carries a replacement speaks for every sibling.
builtin_procedure_deprecation
The replacement when name resolves to a deprecated built-in procedure, None otherwise; the procedure-side twin of crate::function_registry::builtin_function_deprecation and the one lookup the query-notification detector reads. The registry’s deprecated_by field is the whole deprecation fact — None means not deprecated — so the lookup is a field read, never a bridge between two flags.
builtin_procedure_signature
Looks up a built-in procedure signature by name, case-sensitively. CIP-230 (“Casing sensitivity”): built-in function names are case-insensitive, but built-in procedure names are case-sensitive – CALL DB.LABELS() is an UnknownProcedure error, only the exact declared casing (CALL db.labels()) resolves. The validator must agree.
call_is_write
Whether CALL name could write — the namespace gate’s question: a store-registered procedure or a built-in flagged writes in the canonical signature registry (ADR-0116 §4). The gate must never admit a callable to a read view, so registration alone counts.
catalog_create_statements
The store’s whole-catalog DDL statements (ADR-0481 §3): one CREATE INDEX / CREATE CONSTRAINT statement per named catalog entry, in the order the checkpoint manifest persists the catalog (Graph::named_indexes then Graph::named_constraints — the name-keyed catalog’s order; the catalog keeps no creation sequence). Every statement is the SHOW INDEXES / SHOW CONSTRAINTS createStatement rendering with no CYPHER 5 preamble — the dialect’s full form, since a schema mirror must recreate, not hide. An entry whose renderer returns None — exactly the rows where the SHOW column is NULL (a legacy detail-less index row, a graph-type-managed dependent constraint, a kind with no standalone CREATE form) — is absent: its schema is already carried by the graph type’s canonical text or the manifest, never a fabricated statement.
check_explicit_arity
The registry-driven explicit-arity check shared by the generic CALL path and the db.ontology.* executor (the divert’s consumer): an explicit call passes between required and total arguments. (The facade’s compile-time validate_calls already enforces the same contract.)
check_implicit_passing_mode
The passing-mode backstop shared by the generic CALL path and the db.ontology.* executor (the divert’s consumer): an in-query implicit call — a CALL with a YIELD, in a clause pipeline — cannot pass arguments; the procedure’s arguments resolve only in a standalone unit call. required_args is the caller’s registry truth: the number of declared parameters without a default (LABS-389: a procedure whose parameters all carry defaults is callable implicitly). (The facade’s compile-time validate_calls enforces the same contract before execution; this is the executor-side backstop.)
ddl_notifications
The schema-DDL notifications one IR clause raises at EXPLAIN time: the catalog passthrough’s parsed clause and the IR’s own compact legacy CreateIndex/DropIndex shapes all dispatch here, so the statement walker never re-assembles a clause shape across the crate boundary. A non-DDL clause raises none.
execute
Execute a write-capable plan, then validate the constraints against what it wrote (ADR-0172). Each call starts a fresh CSV memo even when graph is reused across statements.
execute_read_at
Execute a read-only plan at the caller-pinned timestamp in admission without repinning. The caller must keep its Graph::pin_now() guard alive through this call so version GC cannot discard rows visible at snapshot_ts, and must capture schema alongside that pin while serializing with graph publication.
is_ontology_procedure
Whether name names one of the db.ontology.* procedures (ADR-0121 as amended by ADR-0227). Derived from the one table so the facade’s compile-time gates (implicit-only, no-mixed-writes, target namespace) and the executor’s CALL dispatch cannot drift apart.
is_ontology_store_op
Whether name names a store-level ontology op (db.ontology.set / db.ontology.drop, ADR-0120 §3) as opposed to the in-overlay apply write or the get read. Derived from the one table the way is_ontology_write_procedure is: the procedure’s signature is flagged ProcSignature::store_level.
is_ontology_write_procedure
Whether name names a db.ontology.* write procedure (set, drop, apply — ADR-0121 as amended by ADR-0227): registered with the prefix AND flagged writes, both read from the one table.
legacy_property_encoding
Encode an IndexDef.property in the legacy {property}#{KIND}#{name} format — the encoder half of split_legacy_property_encoding, which decodes the result back to (property, Some(kind)).
procedure_preview_feature
The preview feature gating procedure name (ADR-0378): Some(PreviewFeature::Ontology) when name resolves to one of the built-in db.ontology.* registry signatures, None for every other name. The lookup is by name against the built-in registry only and never consults the host procedure registry, so a user-registered procedure is not gated — a host db.ontology.custom, for example, resolves to no built-in signature and stays ungated.
props_from_json
Decode a tagged-JSON object into a typed property map. Strict: a non-object payload is an error, never a silently dropped value.
split_legacy_property_encoding
Decode a legacy IndexDef.property string: split the value catalog_create_index (and the constraint-backed index path) into its props head and index kind. A bare property name (no #) is its own head with no kind. The single decoder for this format — every reader of IndexDef.property goes through here.
value_matches_proc_type
Whether a value satisfies a procedure argument type string (STRING, INTEGER, LIST<FLOAT>, …). ANY, an empty type, a nullable ? suffix, and a null value match everything; the accepted type vocabulary is explicit and fails closed, so an unknown (typo’d or unmodelled) type name matches nothing. The precise element-type check of a list happens in the procedure body itself. Used by the executor’s CALL dispatch and re-exported for relate::Database’s compile-time call validation.