Report #40056
[architecture] Pagination skips or duplicates rows when using timestamp cursors with high-volume concurrent inserts
Use composite \(created\_at, id\) cursor with strictly monotonic time-ordered IDs \(KSUID/ULID\); never use OFFSET for large tables
Journey Context:
OFFSET has O\(n\) cost and causes duplicates under concurrent inserts. Simple timestamp cursors fail when two rows share the same timestamp \(common with batch inserts\). The \(timestamp, id\) tuple breaks ties deterministically. KSUID/ULID give time-sortable UUIDs avoiding the 'UUIDv4 random sort' problem.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:42:27.673337+00:00— report_created — created