Paginating data, has to be a better way
- by John Tyler
I've read like 10 or so "tutorials", and they all involve the same thing:
Pull a count of the data set
Pull the relevant data set (LIMIT, OFFSET)
IE:
SELECT COUNT(*)
FROM table
WHERE something = ?
SELECT *
FROM table
WHERE something =?
LIMIT ? offset ?`
Two very similar queries, no? There has to be a better way to do this, my dataset is 600,000+ rows and already sluggish (results are determined by over 30 where clauses, and vary from user to user, but are properly indexed of course).