Bug #1147 innodb and count(*)
Submitted: 27 Aug 2003 0:01 Modified: 27 Aug 2003 3:52
Reporter: Ilya Kotelnikov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:4.0.14-log OS:FreeBSD (FreeBSD)
Assigned to: CPU Architecture:Any

[27 Aug 2003 0:01] Ilya Kotelnikov
Description:
I have innodb table with about 500000 records. Query "select count(*) from Message" running about 30 seconds. There is not any optimizations for this simple query?
show table status:
| Message     | InnoDB | Dynamic    | 502595   | 1028           | 516866048   |                 | 63619072     | 0         | 568307         |             |             |            |                | InnoDB free: 613376 kB |

How to repeat:
create big innodb table and ask it for count(*)

Suggested fix:
optimize count(*)
[27 Aug 2003 3:52] Sergei Golubchik
it's in todo
The difficulty (as compared with MyISAM) is that the row counter can have different values in different open transactions.
[17 Aug 2016 21:32] Sveta Smirnova
This behavior still exists. Please re-open feature request.