Re: Fastest way to get table records' number
| From: | Philip Thompson | Date: | Thu, 20 Mar 2008 14:46:50 +0000 |
| Subject: | Re: Fastest way to get table records' number | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-271889@lists.php.net to get a copy of this message | ||
On Mar 19, 2008, at 11:55 PM, Shelley wrote:
Nathan Nobbe wrote:Just an FYI about your article. "Evan" is supposed to be spelled "even". ;)On Wed, Mar 19, 2008 at 9:42 AM, Andrew Ballard <aballard@gmail.com> wrote: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-tableThat 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
--Regards, Shelley ( PHP Architecture: http://phparch.cn )