5 ms·
Reminds me of Markus Winand who hands out stickers on database conferences banning offset. His site is a great resource for anyone wanting to take a deeper div
by feike 4y ago
Reminds me of Markus Winand who hands out stickers on database conferences banning offset.
His site is a great resource for anyone wanting to take a deeper dive on SQL performance:
https://use-the-index-luke.com/sql/partial-results/fetch-next-page https://use-the-index-luke.com/sql/partial-results/fetch-nex...
- wootest 4y agoWhich in turn reminds me of: http://simonwillison.net/2022/Aug/16/efficient-pagination-using-deferred-joins/ http://simonwillison.net/2022/Aug/16/efficient-pagination-us...
- pvorb 4y agoDo you know if this is specific to MySQL or does it also apply to other RDBMS like PostgreSQL?
- ReactiveJelly 4y agoSo basically do it like Reddit? https://old.reddit.com/?count=25&after=t3_wtpvdp https://old.reddit.com/?count=25&after=t3_wtpvdp I noticed Reddit's pagination has that "after" parameter, which points to the last post on the current page. It glitches out if the last item is deleted by moderators, but otherwise it works smoothly.
- djbusby 4y agoOn Reddit I frequently see the "next" page having the same posts as the previous page. Not all the same but many of the same. Like, maybe after is being respected but the sorting is different or something.
- saghm 4y agoI see that on Hacker News a decent amount as well when going through the top stories across multiple pages. My assumption has always been that the order changes between when I load the page and when I move to the next one (which sometimes is not for another several minutes).
- radiojasper 4y agoYou took some time to read the page and while reading it, the homepage changed and some new posts got added to the top. Therefore some posts get moved to the 2nd page.
- pwinnski 4y agoThe problem with Reddit is that the sorting isn't by time, so the content order changes. The only solution I can think of for that is to track which individual posts have been shown to which users, which is quite a lot of work to do.
- MatmaRex 4y agoYeah, or Wikipedia. https://en.wikipedia.org/w/index.php?title=Category:Living_people&pagefrom=Abath%2C+Edwin%0AEdwin+Abath#mw-pages https://en.wikipedia.org/w/index.php?title=Category:Living_p...
- dinkledunk 4y agohow to jump to an arbitrary page?
- jsmith99 4y agoDo you really need to jump to an arbitrary page and land on the exact item? For many applications an approximate jump is fine. If your column is fairly uniformly distributed you can guess the index for any arbitrary page.
- dinkledunk 4y agoYes, my business users will feel like they don't have sufficient access to their data if they can't. > If your column is fairly uniformly distributed you can guess the index for any arbitrary page. I don't think that'll work in a multi-tenancy situation with complex filters.
- waspight 4y agoI bet your users does not always know what is best for them.
- eurasiantiger 4y agoSome people thoroughly enjoy a linear saccade search! See for example any social media app. It definitely isn’t in the users’ best interest to have any method of scrolling through a lot of records.
- hnuser847 4y agoSpoiler: you can’t.
- thaumasiotes 4y agoBut the entire concept is that this is an adaptation to the fact that data may be added to or removed from the database. If that's true, there would be no benefit in jumping to a specific page - there's no guarantee that that page will display any particular data.
- croes 4y agoCan't he just use rowversion? No need for row value syntax and it works with MS SQL Server