Skip to main content

FETCH_ONCE_MARGIN_MILLI

Constant FETCH_ONCE_MARGIN_MILLI 

Source
pub const FETCH_ONCE_MARGIN_MILLI: u64 = 1_400;
Expand description

How many times over its whole-read price per-page mode may cost before the fetch-once trigger fires, in milli (1400 = 1.4×). The build price is one sequential drain of the arm’s UNCLAMPED estimate (whole_read_rows); the probe price is pages × (seeks × SEEK_EQUIV + matched × MATCHED_ROW_EQUIV).

This is NOT an error correction on the price — it is the empirical placement of the two roads’ FULL-COST crossover, which the fetch-only price cannot see. The drain road pays hash-build, table memory and the bail-out risk on top of its per-row fetch; the per-page road pays its per-batch/per-chunk fixed and consumer assembly on top of its seeks. Measured by forced-side A/B: the flagship’s polluted arm wins as PerPage at a fetch ratio of 1.16, and the deadvar/optional arms win as FetchOnce at 1.52+, so the true crossover lives in (1.2, 1.5). The 2026-11-15 corpus census (40 stamped arms, both scales) centered that gap: every measured-correct PerPage arm prices ≤ 1.22, every measured-correct FetchOnce arm ≥ 1.52; 1.4 sits between with cushion for ρ’s ±15% regime swing on both sides.

Expected drift: as the unmodeled terms get priced into the estimate (the per-batch fixed; the drain-side per-row assembly), the calibrated value should move toward 1000 — re-derive whenever a term lands or the pins move. If an arm ever prices inside the gap, no value here is right: the fix is more model physics, not a new boundary.