Re: Fastest way to get table records' number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nathan Nobbe wrote:
On Wed, Mar 19, 2008 at 9:42 AM, Andrew Ballard <aballard@xxxxxxxxx> 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

The archive of my results was saved here:
http://phparch.cn/index.php/mysql/35-MySQL-programming/126-fastest-way-to-get-total-records-from-a-table

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


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux