Home > Database > Mysql Tutorial > body text

What are the two different states of mysql locks?

PHPz
Release: 2023-06-03 14:00:21
forward
1268 people have browsed it

State lock description

1. Including intention shared locks and intention exclusive locks, which are divided into the core logic of state locks.

2. Both types of locks describe whether a table lock can be added to a table.

When a transaction attempts to lock the entire table (shared lock or row lock), it first needs to obtain the corresponding type of intention lock (intention shared lock or intention shared lock)

Intention shared lock

When a transaction attempts to add a shared lock on the entire table, it first needs to obtain the intention shared lock of the table.

Intention exclusive lock

Before a transaction attempts to lock the entire table, it first needs to obtain the intention lock of the table.

The role of status lock

The locking method of innodb is based on the index, and the locking granularity is row lock. Intention locks exist to coordinate the relationship between row locks and table locks, and support the coexistence of multi-granularity (table locks and row locks) locks.

The above is the detailed content of What are the two different states of mysql locks?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template