starman@programming.dev to Programming@programming.devEnglish · edit-211 months agoWhy You Shouldn’t Use OFFSET and LIMIT For Your Paginationivopereira.netexternal-linkmessage-square18fedilinkarrow-up114arrow-down117file-text
arrow-up1-3arrow-down1external-linkWhy You Shouldn’t Use OFFSET and LIMIT For Your Paginationivopereira.netstarman@programming.dev to Programming@programming.devEnglish · edit-211 months agomessage-square18fedilinkfile-text
If you are wondering why lemmy is moving away from offset pagination since 0.19, here is a nice article about it
minus-squareMegaMacSlice@programming.devlinkfedilinkarrow-up2·11 months 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-squarevzq@lemmy.blahaj.zonelinkfedilinkarrow-up1·11 months agoIt depends on what you want to do and how you want it to behave if data is inserted or deleted. “Ten items after the last one I’ve seen” is another thing than “items 30 to 39”.
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.
It depends on what you want to do and how you want it to behave if data is inserted or deleted. “Ten items after the last one I’ve seen” is another thing than “items 30 to 39”.