Transferred from: https://www.cnblogs.com/changna1314/p/6878900.html
1. Difference:
(1) Transaction processing:
MyISAM is a non-transactional security type, while InnoDB is transaction-safe (supports advanced processing such as transaction processing);
(2) Different locking mechanisms:
MyISAM is a table-level lock, while InnoDB is a row-level lock;
(3) Select, UPDATE, INSERT, delete operation:
MyISAM: If performing a large number of select,myisam is a better choice InnoDB: If your data performs a large number of inserts or update, for performance reasons, you should use the InnoDB table
(4) The number of rows in the query table is different:
Myisam:select Count (*) from Table,myisam as long as the number of rows saved is simply read, note that when the COUNT (*) statement containswhere condition, the operation of the two tables is the sameThe exact number of rows in a table is not saved in Innodb:innodb, that is, when you execute select COUNT (*) from table, InnoDB scans the entire table to calculate how many rows (5) Foreign key support: Mysiam table does not support foreign keys, and InnoDB supports
2. Why MyISAM is faster than InnoDB's query.
InnoDB when doing select, to maintain more than the MyISAM engine much more;
1) data block, InnoDB to cache, MyISAM only cache the index block, which also has the reduction of swap-out;
2) InnoDB addressing to map to the block, and then to the line, MYISAM record is directly the offset of the file, positioning is faster than InnoDB
3) InnoDB also need to maintain MVCC consistent; Although your scene is not, he still needs to check and maintain MVCC (multi-version Concurrency control) Multiple version concurrency control 3. Application Scenarios
MyISAM Suitable for: (1) do a lot of count calculation, (2) Insert infrequently, query very frequently; (3) No transaction.
InnoDB Suitable for: (1) High reliability requirements, or request transactions, (2) Table updates and queries are quite frequent, and the opportunity to lock the row is relatively large situation.
The difference between InnoDB and MyISAM engine and the application scenario