ADR-0016 — No index on the run id
- Status: Accepted
- Date: 2026-11-12
- Supersedes: none
- Authors: project maintainers
Context
delete_for_runs matches the run_id key in checkpoint metadata. Upstream indexes only
thread_id, so without an index of our own it reads every checkpoint to find the matching ones.
Every index on upstream's checkpoints table adds a cost to every put.
Decision
We will not add an index on the run id. delete_for_runs is a rare maintenance call, so it reads
every checkpoint.
Alternatives considered
- An expression index on
metadata->>'run_id'— rejected: on an uncontended host it made ourputon aDeltaChannelgraph 1.12× slower (p50 1.24 → 1.38 ms) and changed no other arm (measuredbefore public release, withbenchmarks/s4_run_index.py(removed before publication)). An earlier run on an IO-contended host is not quoted.
Consequences
delete_for_runscosts a scan ofcheckpoints; it is meant for maintenance, not a hot path.- The same index-cost measurement became the model for the listing index (ADR-0029).
References
- architecture.md §3,
benchmarks/s4_run_index.py(removed before publication)