
Offset vs Cursor Pagination
Why page 5,000 is so slow, and how cursors keep every page fast
What you'll learn
- Why OFFSET gets slower the deeper you go
- How new and deleted rows cause duplicates and skipped items
- How cursor pagination works, with a tie-breaker
- The trade-off: no jumping to page N
In this video, we'll look at why page one of your API loads in 5 milliseconds but page 5,000 is many times slower, and why users scrolling a busy feed see the same items twice. We'll cover how LIMIT and OFFSET work, why deep pages get slower, and how new or deleted rows cause duplicates and skipped items.
We'll also look at cursor (keyset) pagination, how an index lets it jump straight to the next page, and what you give up compared to page numbers.
By the end, you'll know when OFFSET is fine and when a cursor is the better choice for APIs and infinite scroll feeds.



