|
Re: InnoDB - count() slow: msg#01124db.mysql.general
In the last episode (Jun 29), Oleg said: > Hello, > > The query SELECT COUNT(*) FROM table works very slow - for 50 millions > of records it tooks around 5-10 minutes. > Is it a bug or a feature? "Feature". Innodb tables do not cache the rowcount like MyISAM tables do, so mysql has to walk the entire table to get a count. If you have a unique index, it should be able to scan that instead, which will be faster. -- Dan Nelson dnelson@xxxxxxxxxxxxxxx --------------------------------------------------------------------- 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 <mysql-thread113373@xxxxxxxxxxxxxxx> To unsubscribe, e-mail <mysql-unsubscribe-gcdmg-mysql=m.gmane.org@xxxxxxxxxxxxxxx> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Recreating an MS-SQL database in MySQL: 01124, Christopher Bort |
|---|---|
| Next by Date: | Re: Daemon not starting??: 01124, John Coder |
| Previous by Thread: | InnoDB - count() slowi: 01124, Oleg |
| Next by Thread: | LOST mysql.sock: 01124, Rahadul Kabir |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |