引擎
1、innodb 支持事务
锁
- 行锁 - 表锁 - 示例: - 终端: begin; # 开启 select xx from xx for update; commit; # 终止 - pymysql cursor.execute('select * from xx for update') - django with trancation.automic(): models.User.objects.all().for_update()
2、mysiam 不支持事务
只支持表锁
优点:速度快
本文详细对比了MySQL中InnoDB存储引擎与MyISAM存储引擎的主要特性。InnoDB支持事务处理,采用行级锁定,适用于需要事务支持和高并发读写的场景;而MyISAM则仅支持表级锁定,不支持事务,但在读取密集型应用中表现出更高的速度优势。
8815

被折叠的 条评论
为什么被折叠?



