mysqlconcurrencyinnodbisolation-levelmvcc

How does mysql INNODB implement READ-UNCOMMITTED?


I read mysql INNODB uses MVCC (optimistic) to solve READ_COMMITTED and REPEATABLE_READ isolation levels (and) 2PL (pessimistic) to solve SERIALIZABLE. But no where it's mentioned how it solves READ_UNCOMMITTED.

which is true to the statement "Readers don't block Writers and Writers don't block Readers". But, in the case of,

iv) First session writing (and) Second session writing - does INNODB lock the transaction and wait until the other commits/rollback's?

Mysql version: 5.7.32 Engine: INNODB


Solution

  • Locking happens regardless of isolation level. Read-uncommitted is not a free-for-all.

    The first session locked rows that it examined as part of its update, in exactly the same way as it would in any other isolation level. The session holds those locks until it commits its transaction, or rolls back. This is also the same as in any other isolation level.

    By the way, in 30+ years of using SQL databases, I've never encountered a legitimate use for read-uncommitted.