Hi Chris, Thanks for your response.
Actually there is some requirement, where I need to know the number of rows that I will get for my queries before actually executing the query. Could you please suggest some way for this. Thanks Prasad -----Original Message----- From: Chris [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 16, 2006 9:58 AM To: Prasad Ramisetti (WT01 - Broadband Networks) Cc: mysql@lists.mysql.com Subject: Re: problem with InnoDB [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/ The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]