Report #8539
[architecture] OFFSET pagination shows duplicate or missing rows under concurrent writes
Use keyset pagination \(cursor-based\) on an immutable composite key \(created\_at, id\) with a WHERE clause filter, never OFFSET for real-time lists
Journey Context:
OFFSET is O\(n\) and unstable: inserting a row while paginating shifts all subsequent offsets, causing duplicates or skips. Keyset is O\(log n\) and stable under concurrency. Common mistakes: using only created\_at \(timestamp collisions\) or not including the tie-breaker ID, causing cursor ambiguity; or trying to jump to arbitrary page numbers \(impossible with keyset\). Tradeoff: you lose the ability to jump to page 147 directly; only next/prev navigation works.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T05:45:50.810546+00:00— report_created — created