小白学mysql

Consistent Nonlocking Reads

(一致性非锁定读,可以增大并发, 读不加锁)
摘自官方文档:
If the transaction isolation level is REPEATABLE READ (the default level), all consistent reads within the same transaction read the snapshot established by the first such read in that transaction. You can get a fresher snapshot for your queries by committing the current transaction and after that issuing new queries.
With READ COMMITTED isolation level, each consistent read within a transaction sets and reads its own fresh snapshot.

大意是如果事务隔离级别设置repeatable read ,所有同一个事务内的一致性读都会读第一次读的快照,要得到最新的快照需要提交当前事务然后重新查询
如果是read commited 事务每次一致性读会获取最新的快照(不可重复读)

贴图:

read committed 隔离级别下看到最新的版本
read committed 下每次一致性读都可以获取最新快照(不可重复读)
repeatable_read
repeatable read 需要在事务结束后在能获取最新版本快照
在这里插入图片描述
可以看出来repeatable read隔离级别下 一致性读下的所有数据都会取第一次查询这个时间点的快照。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值