Walt, InnoDb physically counts all the rows in the table (unlike MyISAM tables which stores the row count in a separate location). So in your case it went through all 99,994 rows. The more rows you have in the table, the longer it will take. I don't know how accurate "Show table status like ..." is. It may only be updated occasionally.
Mike At 02:52 PM 7/16/2002, you wrote: >I have an INNODB table which has 99994 records in it. customer_number is the >primary key. > >If I run >select count(cutomer_number) from customer; > >It takes about 15 seconds to return the number of rows. >I ran explain on the query and it's using the unique key index on >customer_number. > >If I run >SHOW TABLE STATUS LIKE 'cutomer'; >it only takes about 1.52 seconds for innodb to tell me number of rows. > >Is there a faster way to get the number of rows without using >"show table status" ? > >I ran the same query on an oracle db with 1762058 rows and it took 8 seconds. > >Thanks! >-- > > >--------------------------------------------------------------------- >Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > >To request this thread, e-mail <[EMAIL PROTECTED]> >To unsubscribe, e-mail <[EMAIL PROTECTED]> >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php