我们有两个线程:
第一个线程使 select * from big_table
并迭代它。
第二个线程在此表中插入一行(在第一个线程选择之后),而第一个线程迭代大结果集。第一个线程继续迭代表。
在迭代结束时,第一个线程是否获取第二个线程行插入的值,为什么?
最佳答案
检查 this出:-
One more thing to keep into account – INSERT … SELECT actually performs read in locking mode and so partially bypasses versioning and retrieves latest committed row. So even if you’re operation in REPEATABLE-READ mode, this operation will be performed in READ-COMMITTED
关于select 查询的 mysql 隔离级别(插入可见性),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18514574/