Align ADR-007 repositories sort indexes with the keyset id tiebreaker
What
The four counter/timestamp sort indexes on the repositories table were
specified as (namespace_id, <col>) without the id tiebreaker. Keyset
pagination needs id index-resident, otherwise the ROW(<col>, id) bound
falls to a post-scan sort/filter on these low-cardinality columns
(counters default 0, last_updated_at is NULL on a fresh repo),
degrading deep pages to O(offset) over the namespace.
This adds id DESC to the four indexes so the ADR matches the design and
the implementation. The name sort is unchanged — its (namespace_id, name) unique index is already a deterministic keyset.
Implemented in
gitlab-org/ops/artifact-registry!668 (merged) (S17 Phase 1 Step 4 — keyset index
migration). This handbook change is the paired ADR alignment; the daily
sync:adrs job mirrors it into the service repo's docs/adr/.