myisam 和 innodb 的区别

区别:
1,MyISAM不支持事务,InnoDB支持事务
2,MyISAM不支持外键,InnoDB支持外键
3,MyISAM查询速度快,InnoDB查询速度慢
4,MyISAM支持表锁:

1
update user set name = 'xiaobai' where id = 1;

锁定整张表,不能插入,不能删除,不能修改,可以查询
InnoDB支持行锁:

1
2
update user set name='xiaohua' where id =2;
update user set name = 'xiaohei' where id = 3;

可以同时进行。

实现:
MyISAM和InnoDB都是基于B+树实现,可参考:http://blog.csdn.net/tonyxf121/article/details/8393545