Hacker News new | ask | show | jobs
by perezdev 3664 days ago
Number 2 is kind of funny:

>>The unfortunate part is: pagination is quite complex, and there isn’t a one-size-fits-all solution.

Probably not. But the example he gave is a one size fits most. I've used it on a dozen different projects and have never had performance issue.

3 comments

Problem is actually any ORDER BY operation on a big table, but often it can be fixed with a bit of index magic... on small enough DB (and that's like 99% of web projects) you don't really need to care about this, ever...
And I think when you do encounter a performance issue with LIMIT ... OFFSET, you have to ask yourself "Is a standard CRUD interface pattern really the best way to work with such a large data set?"
For majority of projects limit offset is fine. Some of the linked advice on alternatives is way more horrible like Cursors WTF? this will not scale well.