Description and example usage of mysql Gap Lock
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