5 ms·
The limitation of cursor-based pagination - where you only know the previous, current, and next page's cursor identifier - sounds ideal for infinite scrolling a
by Cthulhu_ 4y ago
The limitation of cursor-based pagination - where you only know the previous, current, and next page's cursor identifier - sounds ideal for infinite scrolling applications, where the user does not get the option to pick a page.
Another solution or optimization I've seen is in forum software, where if a user executes a search, the IDs of the search results are copied into a "search results" table with the equivalent of a session ID; that way, the data remains stable between paging, and the data set over which pagination has to be done (e.g. via offset/limit) is very small; joins can be used to link to the items in question in the search results (e.g. posts, threads), or all the items that need to be shown in the paginated search results can be copied over to the ephemeral search results table.
And of course, since it's ephemeral and memory is cheap these days, the whole search result can be cached in server-side memory.