That's not possible, as the paging routine only stores pageno+1 * pagesize rows in the temp table, because more rows are never required. If the count has to be calculated, all rows have to be read for the COUNT(*), each time the query is ran, which is IMHO slower, especially on very large resultsets.