RE: [PHP] paging methodology
| From: | Chris | Date: | Wed, 05 May 2004 18:23:36 +0000 |
| Subject: | RE: [PHP] paging methodology | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185465@lists.php.net to get a copy of this message | ||
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:cparker@swatgear.com]
Sent: Wednesday, May 05, 2004 11:07 AM
To: php-general@lists.php.net
Subject: RE: [PHP] paging methodology
Chris <mailto:listschris@leftbrained.org>
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