Hacker News new | past | comments | ask | show | jobs | submit login

A B C D

2 items per page

first page is A&B. Next query is "WHERE ID>'B'".

What's the problem?




Aa and Ab are inserted after loading the first page.


That's an orthogonal problem that you need to define correctness for your application.

Because LIMIT...OFFSET will also arguably give you the wrong result. E.g. Aa is inserted. The user will see "B" both as the last item on the first page, and the first item on the second page.

Or with your example:

Aa Ab B C

Now "A" is inserted between page loads. The user will never see "A". What's right for your application? Maybe a notification saying "previous pages have gotten new items". Maybe not. It all depends.

Reddit can be annoying if you go page after page. As stories are bumped down you see them again. That, in my opinion, is a bug. But solving it requires something completely different from merely defining page boundaries.


Sure, and then B comes by again. Which just means there are different use cases with different definitions of correct, and you need to specify yours.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: