Analysis of the Impact of MySQL transaction isolation level on its performance

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.