The difference in composition:
MyISAM
Each myisam is stored on disk as three files. The first file begins with the name of the table, and the extension indicates the file type.
. frm file storage table definition.
The data file has an extension of. MyD (MYData).
The name of the index file extension is. Myi (Myindex).
InnoDB
A disk-based resource is a InnoDB tablespace data file and its log files, and the size of the InnoDB table is limited to the size of the operating system file, typically 2GB
Second, the transaction processing aspect:
MyISAM
Tables of the MyISAM type emphasize performance, which is performed more than the InnoDB type, but does not provide transactional support
InnoDB
InnoDB provides transaction support transactions, external key and other advanced database functions
Three, SELECT Update,insert,delete operation
MyISAM
If performing a lot of Select,myisam is a better choice
InnoDB
1. If your data performs a large number of inserts or updates, for performance reasons, you should use the InnoDB table
2.DELETE from table, InnoDB does not re-establish the table, but deletes one row at a time.
3.LOAD table from Master does not work for InnoDB, the solution is to first change the InnoDB table to MyISAM table, import the data and then change to InnoDB table, but for the use of additional InnoDB features (such as foreign key) of the table does not apply
Iv. operation of the Auto_increment
MyISAM
Internal processing of one auto_incremen column per table.
MyISAM automatically updates this column for insert and update operations. This makes the Auto_increment column faster (at least 10%). The value at the top of the sequence cannot be used again after it has been deleted. (When the Auto_increment column is defined as the last column of a multiple-column index, you can have a situation where the value deleted from the top of the sequence is reused).
Auto_increment value can be reset by ALTER TABLE or MYISAMCH
For fields of type auto_increment, InnoDB must contain an index with only that field, but in MyISAM tables, you can establish a federated index with other fields
Better and faster auto_increment processing
InnoDB
If you specify a auto_increment column for a table, the InnoDB table handle in the data dictionary contains a counter called the automatic growth counter, which is used to assign a new value to the column.
The automatic growth counter is stored only in main memory, not on disk
For the implementation of the calculator algorithm, please refer to the
Auto_increment how to work in InnoDB
Five, the specific number of rows of the table
MyISAM
Select COUNT (*) from Table,myisam as long as you simply read out the number of saved rows, note that when the COUNT (*) statement contains a where condition, the operations of both tables are the same
InnoDB
The exact number of rows for the table is not saved in the InnoDB, that is, when the select count (*) from table is executed, InnoDB scans the entire table to calculate how many rows
Six, lock
MyISAM
Table lock
InnoDB
Provides row locks (locking on row level), providing no lock reads consistent with Oracle type (non-locking read in
Selects), in addition, row locks on innodb tables are not absolute, and if MySQL cannot determine the range to scan when executing an SQL statement, the InnoDB table also locks the entire table, such as Update table set num=1 where name like "% aaa% "