KB-3027

Stage 2.6A — Scale Risk Annotation

2 min read Revision 1
QT001stage2.6AscaleSCALE_NOT_SAFE

07 — Scale Risk Annotation (SUPERTRACK G)

Scale risk is surfaced and carried forward in the plan; it is not solved here (keyset/resume is a NEXT layer).

Objects

  • v_qt001_scale_risk_annotation — per-collection over the full BIRTH_REQUIRED snapshot scope: src_rows, expected_delta, scale_risk band, full_rescan_risk, per_row_correlated_probe, keyset_resume_present, watermark_present, missing_index_risk, scale_note.
  • v_qt001_scale_not_safe_guard — global assertion scale_not_safe = true.

Annotation model

  • scale_risk band by src_rows: CRITICAL ≥ 1,000,000 · HIGH ≥ 100,000 · MEDIUM ≥ 1,000 · LOW otherwise.
  • full_rescan_risk = true and keyset_resume_present = false for all collections: the planner runs correlated birth_registry probes per source row and each batch rescans the full set from the beginning (no watermark).
  • missing_index_risk = false: live check shows birth_registry has UNIQUE(entity_code) and an index on collection_name, so point existence probes are indexed. The scale break is row-by-row probing + no keyset/watermark, not a missing index — this is recorded accurately rather than over-claimed.

Evidence (Codex 08, retained)

fn_dot_birth_qt001_plan_v2(system_issues ~223,952 rows) = 5.079s; fn_qt001_plan_all(74 collections) = 4.942s. Three correlated probes per source row; counters are integer, not bigint. Not acceptable as control-plane preflight toward 100M+.

Guard

v_qt001_scale_not_safe_guard.scale_not_safe = true (pass = true means the guard is correctly flagging the path as not scale-safe). Readiness v3's scale_safe gate reads NOT scale_not_safe and is therefore RED. The NEXT layer must deliver stable keyset ranges, an immutable watermark, per-range ledger, set-based plans, run lease, adaptive batch policy, and a monitoring DOT, then re-measure at representative volume.

Back to Knowledge Hub knowledge/dev/reports/architecture/birth-stage2-6a-qt001-plan-tier-registry-ssot-hardcode-elimination-2026-06-06/07-scale-risk-annotation.md