#1 is the fastest with MySQL.

(copied from MySQL online docs...)
Glenn

a.. COUNT(*) on a single table without a WHERE is retrieved directly from
the table information for MyISAM and HEAP tables. This is also done for any
NOT NULL expression when used with only one table.

.....
examples of queries that are very fast:

mysql> SELECT COUNT(*) FROM tbl_name;

The following queries are resolved using only the index tree (assuming the
indexed columns are numeric):
mysql> SELECT COUNT(*) FROM tbl_name
    ->        WHERE key_part1=val1 AND key_part2=val2;






"K Ūr[" <[EMAIL PROTECTED]> wrote in message
002b01c1ccfb$c9f94a20$0200a8c0@hinet">news:002b01c1ccfb$c9f94a20$0200a8c0@hinet...
Hi,all friends:

Would you please tell me which script in MySQL is  fast?
---------------------------------------------
1.      select count(*) from  bk_data

2.      select count(book_name) from bk_data

---------------------------------------------

PS.  I have 13000 book records  in this table.....

                        Fongming from Taiwan, thanks









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

Reply via email to