3 ms·
Order by the thing you actually care about, like a time stamp. And add an index on that column to make it efficient. You still need to analyze the query to dete
by schrodinger 13y ago
Order by the thing you actually care about, like a time stamp. And add an index on that column to make it efficient. You still need to analyze the query to determine if it's worth adding a covering index, or letting the DBMS perform a key lookup, but that's probably beyond the scope of a comment here.
I guess it's not keyset based paging that is to be avoided, but paging based on a surrogate key which is a meaningless value. If your key had a meaningful value, it's a valid way of writing the query.