当前位置:网站首页>Gap locks
Gap locks
2022-07-25 16:05:00 【Leon_ Jinhai_ Sun】
Gap Locks( Clearance lock ) Used to lock records within a certain range . It blocks intervals in index records , Or the range before the first index record , Or the range after the last index record . It is mainly used for Prevent other transactions from inserting data inside the interval in the index record , And cause unreal reading . about Read submitted (Read Committed, RC) Transaction isolation level ,Gap Locks Will automatically fail .
Data locking range analysis
hypothesis user In the table user_id by Primary key (Primary Key) And for unsigned int type .
select * from user where user_id < 7 for update;The record range locked by the above operation is user_id >= 0 To user_id = 6 The record of , Only after the transaction is committed , Only other transactions can operate records in this range . Notice that even user_id=3 The corresponding record does not exist , Before the transaction is committed , Insert user_id=3 Records are also not allowed , Otherwise, there is no way to solve the problem of unreal reading .
select * from user where user_id > 7 and user_id < 1000 for update;The record range locked by the above operation is user_id > 7 To user_id < 10000 The record of , Only after the transaction is committed , Only other transactions can operate records in this range .
select * from user where user_id > 1000 for update;The record range locked by the above operation is user_id > 1000 To int Record between maximum values , Only after the transaction is committed , Only other transactions can operate records in this range .
边栏推荐
- Leetcode:528. select randomly according to the weight [ordinary random failure + prefix and dichotomy]
- Wavelet transform --dwt2 and wavedec2
- 哪个led显示屏厂家更好
- Permission management - role assignment menu
- 意向锁(Intention Lock)
- Ice 100g network card fragment message hash problem
- I interviewed 8 companies and got 5 offers in a week. Share my experience
- 基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现
- PageHelper.startPage没有生效问题
- ServletConfig 类和ServletContext 类
猜你喜欢

Baseband simulation system experiment of 4pam in Gaussian channel and Rayleigh channel

Upgrade esxi6.7.0 to 7.0u3f (updated on July 12, 2022)

Reasons for data format conversion when matlab reads the displayed image

Matlab -- CVX optimization kit installation

Redis distributed lock, it's really impossible without it

Recommended collection, which is probably the most comprehensive coding method summary of category type features
![[wechat applet] detailed explanation of applet host environment](/img/57/582c07f6e6443f9f139fb1af225ea4.png)
[wechat applet] detailed explanation of applet host environment

Which led display manufacturer is better

电阻电路的等效变化(Ⅱ)

ML - Speech - Introduction to speech processing
随机推荐
今天睡眠质量记录84分
Gap Locks(间隙锁)
共2600页!又一份神级的面试手册面世~
Product upgrade observation station in June
Alibaba's internal "100 billion level concurrent system architecture design notes" are all inclusive, too comprehensive
Sword finger offer | number of 1 in binary
Why is preparestatement better and safer?
MySQL read / write lock
Simple rotation map and hamster beating
How matlab saves all the data after running
Record Locks(记录锁)
How Google cloud disk is associated with Google colab
General test case writing specification
Wavelet transform --dwt2 and wavedec2
如何构建面向海量数据、高实时要求的企业级OLAP数据引擎?
MySQL隐式锁
物理防火墙是什么?有什么作用?
Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%
MQTT X CLI 正式发布:强大易用的 MQTT 5.0 命令行工具
MySQL self incrementing lock