pub struct ClauseMetricsRecord {Show 19 fields
pub stage: usize,
pub part: usize,
pub clause: usize,
pub rows: u64,
pub memory_bytes: u64,
pub expression_built_bytes: u64,
pub time_ns: u128,
pub reads: StoreReads,
pub phases: PhaseTimes,
pub start: Option<WalkStart>,
pub kernel: Option<KernelRung>,
pub batch: BatchFacts,
pub frontier: FrontierCounters,
pub frontier_decline: Option<FrontierDeclineReason>,
pub memo: MemoCounters,
pub intx: InTxBatches,
pub expand_into: ExpandIntoCounters,
pub hash_join: HashJoinCounters,
pub vector_scan: VectorScanCounters,
}Expand description
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.
Fields§
§stage: usizeThe NEXT-chain position (1-based, matching the tree’s stage numbering): each NEXT stage restarts its part indices at 0, so the stage keeps the keys disjoint — without it a chained statement’s later stage overwrites the earlier stage’s entries.
part: usize§clause: usize§rows: u64Rows the operator produced.
memory_bytes: u64Row-materialization bytes: the summed logical size
(Value::logical_bytes, ADR-0042, plus each key’s string bytes)
of the rows the operator produced. Stateful operators’
non-row state (aggregation tables, sort buffers) is a follow-up.
expression_built_bytes: u64Expression allocation bytes the clause’s arm charged against the
ADR-0463 statement budget — the delta of the view’s expression
counter across the arm, the same snapshot/delta shape as
ClauseMetricsRecord::reads. Zero for a clause that builds no
containers or strings.
time_ns: u128The operator’s elapsed time, nanoseconds.
reads: StoreReadsThe store-read mix (LABS-369) behind the operator’s Db Hits
total: hops vs neighbor walks vs node reads.
phases: PhaseTimesThe clause’s inclusive phase times (LABS-448): the seek (candidate resolution and checks) and the walk (relationship traversal), stamped only while a PROFILE statement’s arm runs — a non-PROFILEd statement’s record carries zeros.
start: Option<WalkStart>How the walk chose its start, when the clause ran a MATCH walk
(LABS-369) — None for clauses that walk nothing.
kernel: Option<KernelRung>Which rung served the clause’s MATCH walk (LABS-1117): the
chain kernel, the hub-star kernel, the frontier-NFA rung, or the
per-row walker — the operator the clause’s MATCH ladder (or, for
a SEARCH MATCH, its direct walker call) returned. None
exactly when no MATCH operator ran: a non-MATCH clause; a
MATCH a fold answered (try_match_folds, a boolean or walk
count); a MATCH inside a nested evaluation (its own loop); and a
MATCH the ADR-0468 batch chain answered — that operator is
[Self::batched]’s own fact, never a traversal rung.
batch: BatchFactsWhat ADR-0468’s batch scan/filter/project chain did for the clause: whether it ran and what its filter skipped.
frontier: FrontierCountersThe frontier family’s run counters (ADR-0478): the BFS’s edge
visits, completed levels, and accepted endpoints, summed over the
clause’s per-seed runs. Zero on every clause the frontier’s
compile gates declined (it never ran); a run-time decline
(FrontierDeclineReason::Run) keeps them recorded, since the
rung did run. The plan table’s Details cell marks the operator
([frontier edges=N levels=L endpoints=P]) when it ran.
frontier_decline: Option<FrontierDeclineReason>Why the frontier rung did not serve the clause (ADR-0516, extended
by the plan-time half): the first typed reason, None on every
clause the rung served and on every clause the rung never
considered (no single quantified pattern, the diagnostic switch’s
walk stand-down, a nested evaluation’s own arm). A plan-time
reason (FrontierDeclineReason::Plan) is a gate that kept the
clause off the rung — the clause itself ran no frontier (its counters
stay zero unless a nested EXISTS frontier run in the same clause
contributed); a run-time reason
(FrontierDeclineReason::Run) is the re-arrival budget’s
exhaustion or the table ceiling’s crossing, the counters recorded
beside it.
memo: MemoCountersThe expression-memo counters of the guarded-state memos the clause’s
stage ran (ADR-0654 §3), summed, with disabled_count in place of a
per-memo flag. Zero on every clause that probed no memo; stamped
only while a PROFILE statement’s arm runs.
intx: InTxBatchesThe CALL { … } IN TRANSACTIONS batch facts (REL8-2047) — the one
clause kind that runs batches. Zeroed by the shared record
constructor; the arm’s shared cell stamps its accumulated facts
onto the record at the one site that reports for the arm.
expand_into: ExpandIntoCountersBound-both-ends ExpandInto probes and reversed probes.
hash_join: HashJoinCountersComposable HashJoin and SemiMasker SIP facts.
vector_scan: VectorScanCountersVector scans by serving path (ADR-0705).