Get the App
SLTechnology News&Howtos  ›  Development  › 

Description and example usage of mysql Gap Lock

Shulou Source: shulou.com Published: 2022-06-03 17:26:46 11月13日 Update

This article mainly introduces "the explanation and example usage of mysql gap lock". In daily operation, I believe that many people have doubts about the explanation and example usage of mysql gap lock. The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "explanation and example usage of mysql gap lock". Next, please follow the editor to study!

1. When searching the scope, the entire range of data will be locked.

Even some data that does not exist in this range will be innocently locked. In some scenarios, it can have a great impact on performance.

2. If the execution condition is too large, InnoDB will lock all index key values in the entire range, which can easily affect performance.

Example

First change the value of field a to 1, 3, 5, 7, 9

Window A updates data in the range of a = 1x7

Update test_innodb_lock set bounded b5' where a > 1 and a

Tags: Scope instance gap data learning update performance more help impact practical great successful next location only fields articles methods innocent Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MariaDB Shulou Tech Info Huawei vpn