DEV Community

Discussion on: Why You Shouldn't Use OFFSET and LIMIT For Your Pagination

Collapse
 
itsjzt profile image
Saurabh Sharma

IMO offset based paginations have wierd consistency problems

  • what if someone added a new record, so the offset is shifted by 1 (if sorted by new), and you will get 1 record twice.
Collapse
 
moopet profile image
Ben Sinclair

People are used to that in pagination. Go to ebay and sort by "ending soonest" ad page through. As you go, items will disappear off the top of the results (because they... ended...) and flipping back through pages gets messy. I don't think that's unacceptable.
The same with sharing a link to page 1234 of some results - you know that by the time the recipient opens it, it'll probably be different, so if it's necessary, a "share results page" function could be built to handle it.

Collapse
 
itsjzt profile image
Saurabh Sharma

It would be better if they dont have to