Sorry, I updated the link
Comment on Why You Shouldn’t Use OFFSET and LIMIT For Your Pagination
SpaceNoodle@lemmy.world 1 year ago
Paywall.
starman@programming.dev 1 year ago
Comment on Why You Shouldn’t Use OFFSET and LIMIT For Your Pagination
SpaceNoodle@lemmy.world 1 year ago
Paywall.
Sorry, I updated the link
wccrawford@lemmy.world 1 year ago
ivopereira.net/efficient-pagination-dont-use-offs…
This seems to be the same article.
I have my doubts about the technique, but it could be useful in certain controlled situations.
Max_P@lemmy.max-p.me 1 year ago
Lemmy just implemented it for 0.19 and it makes a big difference on heavier queries like Scaled homepage.
It also has the advantage of your pagination not getting screwy if new content has been added between page 2 and 3 queries.
MegaMacSlice@programming.dev 1 year ago
I was going to recommend looking at www.elastic.co/…/paginate-search-results.html#scr… - but it looks like that method is now not advised- but if you read up above it it looks like there’s a search_after/PIT method described which sounds similar to the article.
This is all to say - I don’t think this is a one-off concept - it’s been around for a bit.
vzq@lemmy.blahaj.zone 1 year ago
This is completely uncontroversial advice and has been for 30 years. What are your doubts exactly?
I’d go further: if you see a query that uses “offset” on a non-trivial production DB something is very, very wrong.
Of course, the trick is that you need to make sure you have indexes for all sort orders you need to display, but that’s obvious.
SpaceNoodle@lemmy.world 1 year ago
Thanks! Agreed, it’s a very limited usecase.