An efficient alternative to paging with SQL OFFSETs

Challenge Running WordPress.com means having multimillion-record database tables. Tables which we often need to batch-query. Provided we could hardly select (or update, etc) millions of records at once and expect speed, we commonly have to “page” our scripts to only handle a limited number of records at once, then move on to the next batch. ... Read More.