[EMAIL PROTECTED] wrote:
Hi ,
select count(*) is painfully slow in case of innoDB when the number of
records are around 1 million. Ths select count(*) query in myISAM takes
0.01 secs and the same query in InnoDB takes around 20.15 secs.
Can anybody suggest me how to speed up this query ?
You can't.
InnoDB is transactional which means it can't keep basic information like
the number of rows it has up to date (which means any number of inserts/
updates/deletes can happen at one time).
MyISAM is not transactional (so only one insert/update/delete can happen
at one time) so it can keep this information.
What context are you trying to do a count in? Maybe it would be better
to have an extra field in another table and keep that counter up to date?
I know this relates to postgresql but the same idea could be useful for you:
http://www.designmagick.com/article/36/
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]