ADR-0029 — The listing index
- Status: Superseded by ADR-0040
- Date: 2026-11-13 (bar); 2026-11-14 (outcome)
- Supersedes: none
- Authors: project maintainers
Context
Upstream indexes only thread_id, so finding each thread's latest root checkpoint scans
checkpoints. A partial index makes listing cheap, but every index on upstream's table adds a cost
to every put, and an earlier candidate, the run-id index, was rejected for that cost
(ADR-0016).
The bar set before measuring: add the partial index opc_checkpoints_root_latest on
checkpoints (checkpoint_id) WHERE checkpoint_ns = '' only if our put p50 with it is at most
1.05× ours without it on every benchmark arm and every acceptance bar
(ADR-0005) still holds; otherwise add no index, have listing read head
rows, and document its per-thread cost and its gap for threads with no head row. The bar is a
target (claimed).
Decision
We keep the index.
Two clean, uncontended runs disagreed on the DeltaChannel arms: our put p50 was 1.127×
sequential and 1.072× at K=8 in one, 1.007× and 0.982× in the other, on puts of about 1.1 ms. Every
plain-graph and fan-out arm stayed within 1.05× in both. A 20-thread page at 20,000 threads took
0.7 ms unfiltered with the index, against about 150 ms for the head-row fallback (all measured
before public release; thread-listing.md §4.1). A cost of at
most about 0.15 ms per DeltaChannel put (inferred from those runs) is worth a listing 50–200×
faster (inferred from the same runs).
Alternatives considered
- No index, listing reads head rows — rejected on the measurement above; it also misses threads that have no head row.
Consequences
- One run put the index over its own bar on the
DeltaChannelarms; the project accepts that cost. - The index is ours on upstream's table;
rehydrateleaves it, and dropping it is part of the manual clean-up (compatibility.md).
References
- thread-listing.md §3.5 and §4,
benchmarks/list_index.py