It's certainly faster than "SELECT COUNT(*) FROM sometable WHERE . . .";

It might not be faster than "SELECT COUNT(*) FROM sometable", as that is
designed to run very quickly.

The documentation for the FOUND_ROWS() function is here:
http://dev.mysql.com/doc/mysql/en/Information_functions.html

Chris

-----Original Message-----
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 05, 2004 11:07 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] paging methodology


Chris <mailto:[EMAIL PROTECTED]>
    on Wednesday, May 05, 2004 10:56 AM said:

> If you're using MySQL 4+ you could use the SQL_CALC_FOUND_ROWS flag
> in the select statement.
>
> It causes the query to count the number of rows it *would have*
> returned if there had been no limit clause.

do you know if that's any faster than doing a "SELECT COUNT(*) FROM
table WHERE ..." ?


chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to