Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the function of mysql intention locking?

Shulou Source: shulou.com Published: 2022-06-03 10:37:42 11月12日 Update

What is the role of mysql intention lock, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

When adding an exclusive lock, you need to determine whether any data rows in the table are locked (row locks) according to the intention lock.

1. If the intention lock is a row lock, you need to confirm each row of data.

2. If the intentional lock is a table lock, you only need to judge once to know whether any data rows are locked in order to improve performance.

Example

Trx1:1. BEGIN2. Trx1 adds an X lock to T1 to modify the table structure. Trx2:1. BEGIN2. Trx2 adds an IX lock to T1 (the transaction is blocked, waiting for the lock to succeed) 3. Trx2 adds an S or X lock to a row of T1 records. Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Intention data help role clarity success one line transaction content just need instance this performance article novice more knowledge structure industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Huawei Shulou Technology Docker OPPO Reno