Mysql Glossary
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 下每次一致性读都可以获取最新快照(不可重复读)
repeatable read 需要在事务结束后在能获取最新版本快照
可以看出来repeatable read隔离级别下 一致性读下的所有数据都会取第一次查询这个时间点的快照。