Nathan Nobbe wrote:
On Wed, Mar 19, 2008 at 9:42 AM, Andrew Ballard <[EMAIL PROTECTED]> wrote:

That works; I'm just wondering why you went with a count on an 'ID' column
rather than COUNT(*).


ouch, it looks like im horribly wrong :O
mysql> select count(*) from table;
+----------+
| count(*) |
+----------+
|   361724 |
+----------+
1 row in set (0.90 sec)

mysql> select count(id) from table;
+------------+
| count(did) |
+------------+
|     361724 |
+------------+
1 row in set (4.56 sec)

-nathan

Here is a further test with more records:

mysql> select count(*) from table1;
+----------+
| count(*) |
+----------+
| 20795139 |
+----------+
1 row in set (1 min 8.22 sec)

mysql> select count(id) from table1;
+-----------+
| count(id) |
+-----------+
|  20795139 |
+-----------+
1 row in set (1 min 1.45 sec)

mysql> select count(1) from table1;
+----------+
| count(1) |
+----------+
| 20795139 |
+----------+
1 row in set (56.67 sec)

count(1) wins.

--
Regards,
Shelley ( PHP Architecture: http://phparch.cn )


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

Reply via email to