Innodb/MyISAM query performance differences
Two tables, identical other than one is Innodb and the other MyISAM. 15.4 million rows in each.
Innodb:
explain select count(*) from thetable;
+----+-------------+---------+-------+---------------+---------+---------+------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+---------+-------+---------------+---------+---------+------+----------+-------------+
| 1 | SIMPLE | thetable | index | NULL | PRIMARY | 4 | NULL | 16019217 | Using index |
+----+-------------+---------+-------+---------------+---------+---------+------+----------+-------------+
The query takes more the five (5) minutes.
MyISAM:
explain select count(*) from thetable;
+----+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
| 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Select tables optimized away |
+----+-------------+-------+------+---------------+------+---------+------+------+------------------------------+
This query executes in 0.00 seconds.
Why the difference in query plans? Can I force Innodb to query more efficiently?
Thanks,
Callum
Subject
Views
Written By
Posted
Innodb/MyISAM query performance differences
1623
June 05, 2006 04:02PM
990
June 05, 2006 05:48PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.