Skip to main content

ClauseMetricsRecord

Struct ClauseMetricsRecord 

Source
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: usize

The 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: u64

Rows the operator produced.

§memory_bytes: u64

Row-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: u64

Expression 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: u128

The operator’s elapsed time, nanoseconds.

§reads: StoreReads

The store-read mix (LABS-369) behind the operator’s Db Hits total: hops vs neighbor walks vs node reads.

§phases: PhaseTimes

The 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: BatchFacts

What ADR-0468’s batch scan/filter/project chain did for the clause: whether it ran and what its filter skipped.

§frontier: FrontierCounters

The 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: MemoCounters

The 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: InTxBatches

The 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: ExpandIntoCounters

Bound-both-ends ExpandInto probes and reversed probes.

§hash_join: HashJoinCounters

Composable HashJoin and SemiMasker SIP facts.

§vector_scan: VectorScanCounters

Vector scans by serving path (ADR-0705).

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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