MySQL半一致性读原理解析-从源码角度解析

191 篇文章 87 订阅 ¥9.90 ¥99.00
123 篇文章 65 订阅 ¥19.90 ¥99.00
本文探讨了MySQL半一致性读的概念,它在更新语句中减少锁冲突和等待,但可能对binlog安全性产生影响。半一致性读发生在RC隔离级别或innodb_locks_unsafe_for_binlog开启时,涉及MySQL和InnoDB层的配合,通过尝试构建和返回记录的prev版本来避免锁等待。同时,文章介绍了其工作原理,包括锁等待条件、索引要求以及在不同情况下的锁处理策略。
摘要由CSDN通过智能技术生成

1、什么是半一致性读

A type of read operation used for UPDATE statements, that is a combination of read committed and consistent read. When an UPDATE statement examines a row that is already locked, InnoDB returns the latest committed version to MySQL so that MySQL can determine whether the row matches the WHERE condition of the UPDATE. If the row matches (must be updated), MySQL reads the row again, and this time InnoDB either locks it or waits for a lock on it. This type of read operation can only happen when the transaction has the read committed isolation level, or when the innodb_locks_unsafe_for_binlog option is enabled.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yzs87

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值