From: "Chris W. Parker" <[EMAIL PROTECTED]>

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

I did a couple (unscientific) tests and there doesn't seem to be much of a
difference. I'd use the COUNT(*) method just because it's more portable,
though.

---John Holmes...

mysql> select count(id) from status_history where date between
20040101000000 AND 20040501000000;
+-----------+
| count(id) |
+-----------+
|     27791 |
+-----------+
1 row in set (0.13 sec)

mysql> select * from status_history where date between 20040101000000 AND
20040501000000 LIMIT 2000,100;
100 rows in set (0.02 sec)

mysql> select SQL_CALC_FOUND_ROWS * from status_history where date between
20040101000000 AND 20040501000000 LIMIT 2000,100;
100 rows in set (0.14 sec)

mysql> select found_rows();
+--------------+
| found_rows() |
+--------------+
|        27791 |
+--------------+
1 row in set (0.00 sec)

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

Reply via email to