This is always mentioned that InnoDB is slower in giving results for COUNT(*) as compared to MyISAM. But as Peter points out in his blog that this fact only applies to COUNT(*) queries without WHERE clause. This text is from Peter's blog only - "If you have query like SELECT COUNT(*) FROM IMAGE WHERE USER_ID=5 this query will be executed same way both for MyISAM and Innodb tables by performing index rage scan. This can be faster or slower both for MyISAM and Innodb depending on various conditions." Let's see what EXPLAIN has in store for us.
1: mysql> CREATE TABLE `test_index` (
2: `id` int(11) NOT NULL AUTO_INCREMENT,
3: `x` int(11) DEFAULT NULL,
4: `y` int(11) DEFAULT NULL,
5: `z` varchar(255) NOT NULL DEFAULT 'testing',
6: PRIMARY KEY (`id`),
7: …[Read more]