What is InnoDB and MyISAM in MySQL?

前端 未结 8 691
长情又很酷
长情又很酷 2020-12-07 09:19

What is InnoDB and MyISAM in MySQL ?

8条回答
  •  Happy的楠姐
    2020-12-07 09:45

    MyISAM does not follow ACID as opposed to InnoDB which follows transactions to maintain integrity of the data.

    MyISAM supports concurrent inserts: If a table has no free blocks in the middle of the data file, you can INSERT new rows into it at the same time that other threads are reading from the table. MySqlDoc

    That is why, MyISAM is faster and takes less space. For instance, the MySQL MyISAM Storage Engine does not support tranactions.constraints of MySQL MYISAM There is a bit called concurrent-insert By default, the variable is set to 1 and concurrent inserts are handled as just described. If it is set to 0, concurrent inserts are disabled. If it is set to 2, concurrent inserts at the end of the table are permitted even for tables that have deleted rows. An INSERT statement can be executed to add rows to the end of the table with select at same time if there are no holes/deleted rows in middle of table (at time of concurrent insert).

    The default isolation level og mysql InnoDB is "Read Repeatable". For MyISAM, there is no transaction. InnoDB uses row level locking while MyISAM can only use table level locking that is why InnoDB has crash revovery is better than MyISAM. One has to manually acquire the table level lock in MyISAM if one wants to avoid the concurrency effects.

提交回复
热议问题