pub struct ClauseMetricsRecord {Show 15 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 batched: bool,
pub zone_skips: u64,
pub frontier: FrontierCounters,
pub frontier_decline: Option<FrontierRunDecline>,
}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::db_hits]. Zero for a clause that builds no
containers or strings.
time_ns: u128The operator’s elapsed time, nanoseconds.
reads: StoreReadsThe store-read mix behind [ClauseMetricsRecord::db_hits]
(LABS-369): 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.
batched: boolWhether the clause ran ADR-0468’s batch scan/filter/project chain
over Chunk (LABS-359) — the PROFILE-visible fact that a
scan-shaped MATCH interior executed as batch operators. false
is every other clause, and every clause the chain declined.
zone_skips: u64The batch filter’s zone skips (LABS-645): how many conjunct-batch
evaluations the chunk’s derived min/max zone metadata provably
replaced with the correct empty survivor set. 0 on every clause
the chain declined and every clause that skipped nothing.
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
(frontier_decline set) 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<FrontierRunDecline>The frontier rung’s run-time decline (ADR-0516), when it engaged,
ran, and fell through — None on every clause that never
declined and on every compile-gate decline (which never ran). The
typed reason the PROFILE record carries beside the run counters:
the re-arrival budget’s exhaustion or the table ceiling’s crossing.