Mysql innodb insert intention lock, mysqlinnodb

Source: Internet
Author: User

Mysql innodb insert intention lock, mysqlinnodb

Innodb has an insert intention lock, specifically for Insert. If the gap is already locked by the gap before insertion, insert will apply for the Insert intention lock. So what is the role of this inserted intention lock?

1. In order to arouse the waiting. Because the gap already has a lock, it must be blocked during insertion. The intention lock is inserted with blocking function.

2. inserting the intention lock is a special gap lock. Since it is a gap lock, why not directly use the gap lock?

The gap locks are not mutually exclusive. If they are not blocked, they call up the wait, which may cause phantom read.

3. Why not use the record lock or next-key lock?

If the record or next-key lock is applied, the next-key lock may be mutually exclusive, which affects the insert concurrency.


I don't know if this understanding is correct. Have you studied inserting intention locks? Can you give me a suggestion?

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.