improve speed of record count by using SQL_CALC_FOUND_ROWS