starman@programming.dev to Programming@programming.devEnglish · edit-21 year agoWhy You Shouldn’t Use OFFSET and LIMIT For Your Paginationivopereira.netexternal-linkmessage-square16linkfedilinkarrow-up114file-text
arrow-up114external-linkWhy You Shouldn’t Use OFFSET and LIMIT For Your Paginationivopereira.netstarman@programming.dev to Programming@programming.devEnglish · edit-21 year agomessage-square16linkfedilinkfile-text
If you are wondering why lemmy is moving away from offset pagination since 0.19, here is a nice article about it
minus-squareWilliam@lemmy.worldlinkfedilinkarrow-up10·1 year agohttps://ivopereira.net/efficient-pagination-dont-use-offset-limit This seems to be the same article. I have my doubts about the technique, but it could be useful in certain controlled situations.
minus-squareMax-P@lemmy.max-p.melinkfedilinkarrow-up6·1 year agoLemmy 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.
minus-squareMegaMacSlice@programming.devlinkfedilinkarrow-up3·1 year agoI was going to recommend looking at https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html#scroll-search-results - 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.
minus-squareSpaceNoodle@lemmy.worldlinkfedilinkarrow-up1·1 year agoThanks! Agreed, it’s a very limited usecase.
https://ivopereira.net/efficient-pagination-dont-use-offset-limit
This seems to be the same article.
I have my doubts about the technique, but it could be useful in certain controlled situations.
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.
I was going to recommend looking at https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html#scroll-search-results - 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.
deleted by creator
Thanks! Agreed, it’s a very limited usecase.
deleted by creator