Files
Hui-s-notebook/logseq-java/pages/MySQL锁.md
2024-02-02 00:12:49 +08:00

19 lines
594 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
- 表锁和行锁的区别
- 表锁
- 串行化时,整个表加锁,锁住整个表
- 行锁
- 非串行化时InnoDB使用的是行锁只锁一行数据
- 通过mvcc完成的
- 共享锁
- 排他锁
- 意向锁
- 所有操作之前都要申请一个意向锁,属于表锁,意向锁之间不会冲突,会和表锁冲突
- 意向共享锁
- 意向排他锁
- 间隙锁
- 锁定多行数据
- next-key锁
- 避免一些幻读操作
- 当前读和快照读
- 锁定读的时候读到的最新版本的数据
- 可重复读下mvcc生效的是快照读读取数据快照