Subject Fw: Will SELECT COUNT(*) FROM TABLE ever be cheap on INNODB?
Author Martijn Tonies
Yep, InnoDB is suffering from the same problem as Fb :-)

From the "mysql" list.


> MyISAM has a cool feature where it keeps track of the internal row
> count so that
>
> SELECT COUNT(*) FROM FOO executes in constant time. Usually 1ms or so.
>
> The same query on INNODB is O(logN) since it uses the btree to
> satisfy the query.
>
> I believe that MyISAM just increments an internal count so that every
> insert/delete changes the count.
>
> Are there plans to add this to INNODB? I was relying on this for my
> database monitoring app and noticed that it was killing my
> performance (I forgot about this problem...)
>
> Would be really nice to have.


With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com