MySQL Forums
Forum List  »  InnoDB

Re: COUNT(*) on innodb
Posted by: Jay Pipes
Date: November 24, 2005 12:39PM

Not necessarily, just wanted some more information. SELECT COUNT(*) FROM some_table is handled very differently in InnoDB versus MyISAM, which will return the result directly from the .MYI/.MYD header information. With InnoDB, it's more complicated, and has been the cause of a number of frustrations for forum web sites trying to move from MyISAM to InnoDB (forum software typically has a lot of SELECT COUNT(*) type queries). InnoDB still has this restriction, and the most common workaround is to keep a counter table which gets updated with the number of rows when you INSERT/DELETE from the table. You can read more here:

http://dev.mysql.com/doc/refman/5.0/en/innodb-restrictions.html

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Views
Written By
Posted
12459
November 24, 2005 09:15AM
4775
November 24, 2005 09:46AM
4488
November 24, 2005 11:53AM
4180
November 24, 2005 12:16PM
Re: COUNT(*) on innodb
4134
November 24, 2005 12:39PM
3775
November 24, 2005 12:55PM
4277
November 24, 2005 01:03PM
3281
November 24, 2005 01:11PM
3232
November 24, 2005 01:32PM
2975
November 24, 2005 02:07PM
3516
November 24, 2005 08:00PM
2981
November 24, 2005 08:38PM
2830
November 25, 2005 05:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.