3 ms·
A key option is missing from this list: returning everything (with a sanity LIMIT far beyond the usual result count) and just doing the pagination in JavaScript
by skrebbel 9y ago
A key option is missing from this list: returning everything (with a sanity LIMIT far beyond the usual result count) and just doing the pagination in JavaScript.
I'm sure this will get me all kinds of backlash from noscript purists and optimization fanatics, but it works great, is easy to implement, there's millions of JS table/list libraries that give you the pagination for free (plus free sorting and filtering).
It is by far the most productive option for the developer, if the data size allows (I'd wager it often does), and it does not even have the problems this article describes about OFFSET.
- tragic 9y agoFrom paragraph 2 of TFA: > Before continuing it makes sense to mention client-side pagination. Some applications transfer all (or a large part) of the server information to the client and paginate there. For small amounts of data client-side pagination can be a better choice, reducing HTTP calls. It gets impractical when records begin numbering in the thousands.
- skrebbel 9y agoAh damn, missed that. Thanks.