Hi,
On a table with 1,00,000 records, Normally we doing this kind of process
Code:
SELECT count(1) FROM mytable WHERE ... (to get the total count)
SELECT * FROM mytable WHERE ... LIMIT 50
In MySQL advanced to fatch the data, this format is more than 3 time faster than doing. Code:
SELECT SQL_CALC_FOUND_ROWS * FROM mytable WHERE ... LIMIT 1,50
SELECT FOUND_ROWS();
MySQL to calculate how many rows there would be in the result set, disregarding any LIMIT clause. The number of rows can then be retrieved with
SELECT FOUND_ROWS().