The main difference between InnoDB and Myisam in Mysql storage engine

In the mysql command window, enter show engines, you can see all the engines of mysql, so there are so many engines, we often use two, MyISAM and InnoDB, what is the difference between these two engines?


1. Transaction processing
innodb supports transaction function, but myisam does not.
Myisam executes faster and performs better.

 

2,select ,update ,insert ,delete operation

MyISAM: If you perform a large number of SELECTs, MyISAM is a better choice
InnoDB: If your data performs a large number of INSERT or UPDATE, for performance reasons, you should use InnoDB tables

3. The locking mechanism is different

InnoDB is a row-level lock, and myisam is a table-level lock.
Note: When the database cannot determine the row being found, it will also become a lock on the entire table.
Such as: update table set num = 10 where username like "%test%";

4. The number of rows in the query table is different from
MyISAM: select count(*) from table, MyISAM simply reads the number of saved rows. Note that when the count(*) statement contains the where condition, the operations of the two tables it's the same

InnoDB: InnoDB does not save the specific row number of the table, that is to say, when executing select count(*) from table, Inn

Guess you like

Origin blog.csdn.net/caryxp/article/details/132354066