Jump to content

SQL_CALC_FOUND_ROWS


jonniejoejonson

Recommended Posts

mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name

    -> WHERE id > 100 LIMIT 10;

mysql> SELECT FOUND_ROWS();

 

 

Is this faster than if I created a second query that simply counted the rows without the LIMIT.

 

i.e.. when you use SELECT SQL_CALC_FOUND_ROWS, does it actually select all the records in the table that are not within the limit, or does it just COUNT the number of rows that are not within the limit, because by selecting them all it is going to slow it down... any ideas regards J.

Link to comment
https://forums.phpfreaks.com/topic/82673-sql_calc_found_rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.