跳轉到

pagination

Offset-based Pagination

  • easy to implement, stateless
  • directly addressable pages
  • slow for deep pages
select * from people
order by id
limit 10
offset 2

Cursor-based Pagination

  • more complicated, stateful
  • more performant
  • more resilient to drift
select * from people
where id > 10
order by id
limit 10