Very classic MySQL interpretation of the magic read

Source: Internet
Author: User

Http://blog.sina.com.cn/s/blog_499740cb0100ugs7.html

The above link is a classic explanation of why MySQL's MVCC partially solves the problem of Phantom reading.

At the same time I need to understand that in business logic, transactions can be scattered in the business code, not to say a statement written. For example, we started a transaction, start transaction. First get the data in the database, then in the business to determine whether the condition conforms to its own business logic, if so, then you can insert a portion of the data. But this time there may be other data inserted, resulting in a conflict, resulting in the current data insertion is unsuccessful. To form a strange phenomenon. So this time select needs to use the lock in share model. This enables the transaction to be started using Next-key technology. The information obtained is guaranteed to be the current read data, not the snapshot read.

Very classic MySQL interpretation of the magic read

Related Article

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.