Analysis of the Impact of MySQL transaction isolation level on its performance MySQL transaction isolation level is divided into four levels: 1. READUNCOMMITTED & nbs ..
Analysis of the Impact of MySQL transaction isolation level on its performance MySQL transaction isolation level is divided into four levels: 1. READUNCOMMITTED & nbs ..
Analysis of the Impact of MySQL transaction isolation level on its performance
MySQL isolates transactions at four levels:
1. read uncommitted read not submitted
2. read committed read commit
3. REPEATABLE
4. SERIALIABLE
MySQL works under Level 3 by default. We know that transaction isolation aims to avoid inconsistent data import because concurrent operations affect each other. Therefore, transaction isolation is introduced to ensure data consistency. The above four levels of data consistency protection are gradually improved. Level 4 has the best effect on transaction isolation, but has the worst performance. It is generally not used in the production environment.
The following examples are used to check the impact on MySQL performance at different levels. My experiment environment is: Redhat5.8 + MySQL5.5
First, we enable two sessions:
1. Verification Level 1 features
The operations we perform on session A are as follows:
This sets up the effect of serialize isolation, which is also why the concurrency capability of serialize isolation is poor.
I have uploaded the data used for the experiment test.
This article is from the "Zhang zhiliang" blog. For more information, contact the author!