This blog post mainly summarizes the differences between MyISAM and InnoDB
InnoDB and MyISAM are the two most commonly used table types when using MySQL , both table types have their own advantages and disadvantages, depending on the specific application. The basic differences are:
(1) The MyISAM type does not support advanced processing such as transaction processing, while the InnoDB type supports transactions.
(2) InnoDB supports data row locking; MyISAM does not support row locking and only supports locking the entire table. It should be noted here that the row lock of the InnoDB table is not absolute. If MySQL cannot determine the range to be scanned when executing a SQL statement, the InnoDB table will also lock the entire table, for example, update table set num=1 where name like “% aaa%”
(3) InnoDB supports foreign keys, but MyISAM does not.
(4) InnoDB does not save the specific number of rows in the table. That is to say, when executing select count() from table, InnoDB has to scan the entire table to calculate how many rows there are. But MyISAM simply reads the number of saved rows. Note that when the count() statement contains where conditions, the operations of the two tables are the same.
The above is the detailed content of High-performance MySQL-Introduction to the basic differences between storage engines MyISAM and InnoDB. For more information, please follow other related articles on the PHP Chinese website!