[mysql] MyISAM is more efficient than InnoDB query process




When querying non primary key fields, MyISAM has better query performance. From the design of index file data file, each index field of MyISAM has the above index tree:

MyISAM can locate the data record directly after finding the physical address directly, but after InnoDB queries the leaf node, it needs to query the primary key index tree again to locate the specific data.

It means that MyISAM can find the data in one step, but InnoDB needs two steps. Of course, MyISAM has higher query performance


InnoDB is better when querying the fields of the primary key, because the data is directly obtained from the clustered index of the primary key, and there is no need to use the pointer to get it again