Hi!

On Dec 04, Gurupartap Davis wrote:
> I'm converting a table to innodb from myisam in mysql 4.0 and I was
> wondering why it takes sooo long to do a SELECT COUNT(*)

MyISAM stores total number of rows in MYI file header.
It's read into memory when table is opened.

So for SELECT COUNT(*) FROM MyISAM_table
NySQL need not acess data or even index - it can return an
answer immidiately.

InnoDB doesn't store total number of rows anywhere (afaik).

Regards,
Sergei

-- 
MySQL Development Team
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
       <___/

---------------------------------------------------------------------
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

Reply via email to