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

If you mean pagination, then window functions are not the right tool. Keyset pagination in standard SQL:

https://use-the-index-luke.com/sql/partial-results/fetch-nex...

https://use-the-index-luke.com/no-offset




Both of these are bad for pagination - if the dataset isn't read-only. If the search criteria matches 100 rows at the time of the request, you may want to page through those matches, even if, by the time the client (human or machine) gets to page three, the query matches 80 or 110 rows - or worse, if the query still matches 100 rows, but not all of them are the same as the original 100!

You would normally capture such state by using cursors.


Could you elaborate on "using cursors" part? Are you talking about database-level cursors? If so, do you know any resources which cover this approach?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: