How do I set the isolation level of MySQL 5.1 InnoDB?
By entering:
mysql> show variables like '%isola%';
The default level set for InnoDB is repeatable read.
How do I change the isolation level?
Isolation is the I in the acronym ACID; the isolation level is the setting that fine-tunes the balance between performance and reliability, consistency, and reproducibility of results when multiple transactions are making changes and performing queries at the same time.
Transaction isolation levels are a measure of the extent to which transaction isolation succeeds. In particular, transaction isolation levels are defined by the presence or absence of the following phenomena: Dirty Reads A dirty read occurs when a transaction reads data that has not yet been committed.
The SET TRANSACTION Statement in MYSQL is used to set the values to the characteristics of the current transaction such as transaction isolation level and access mode.
There's no snapshot isolation level in MySQL. It uses snapshot for Consistent Nonlocking Reads, but it doesn't mean it supports snapshot isolation. According to the Wikipedia page, only databases below support snapshot isolation. But the REPEATABLE READ level doesn't do this at all, though it uses snapshot.
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SESSION
is optional, just limits the setting to the current session.READ UNCOMMITTED
is to be replaced with your desired level.
https://dev.mysql.com/doc/refman/8.0/en/set-transaction.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With