The other day, I found that the function FOUND_ROWS()( here ) in MySQL and the corresponding option SQL_CALC_FOUND_ROWS. Later it looks especially useful (instead of running a second query to get the number of rows).
I’m wondering what effect does adding SQL_CALC_FOUND_ROWSto a query have on speed ?
I guess this will be much faster than running the second query to count the rows, but whether it will be completely different. In addition, I found a query restriction to make it much faster (for example, when you get the first 10 rows of 1000 each). Will adding SQL_CALC_FOUND_ROWSto a request with a small limit make the request run much slower?
I know I can check it out, but I'm curious about common practices here.
source
share