Earlier quoted context omitted.
We can technically offer the users Nth page with cursors+offset hybrid, if we're fine with the computational demands (smaller than pure offset, but bigger than just prev|next|last). Let's say we want to offer the user 5 pages, 100 records per page: prev (7) | next (9) | 10 | 11 | 12 | 13 | 14 | ... | last If you click "13", you'd need to query with cursor for page 9 (i.e. id > last rec of page 8) , and offset 400 lim…
You can also just query 5*100 IDs (keysets actually) and insert them into temporary table, all in a single SQL query, retrieve 100 full records in 2nd query, and get cursors for next/prev pages in third query (I'm not sure about this part, would need some windowing query I guess). It may seem wasteful, but in my experience it's fast (though I don't really have "Big Data" to test on). I do something similar to check i…
The thing is, the cursor is a lookup on an indexed sorted index, it's O(log N), it's effectively free already. And we add the cost of materializing the slice (if even just in memory), and introducing the potential of DoS-ing our server with this temporary state if we're not careful.