当前位置:网站首页>Different operating with different locks, rounding
Different operating with different locks, rounding
2022-08-01 20:00:00 【dog studying hard】
- A read operation performed by a transaction using MVCC is called a consistent read (or snapshot read).All ordinary SELECT statements are snapshot reads under the RC (read committed) and RR (repeatable read) isolation levels. Consistent reads will not lock any records in the table, and other transactions can freely access the table.Make changes to records in
select * from table_nameselect * from table_name t1 Inner Join table_name_name t2 on t2.id = t1.id
- The lock read of the shared lock, if the current transaction executes the lock read, then the S lock (shared) will be added, and other transactions can continue to obtain the S lock of these records, but cannot obtain these records.The X lock cannot directly change these records.If other transactions want to acquire the corresponding X lock, they will be blocked and wait until the current transaction's S lock is released
select * from table_name LOCK IN SHARE MODE
- Exclusive lock lock read, if the statement is executed, X lock will be added to the record, other transactions cannot obtain the S lock of these records, nor can they obtain the X lock of these records, direct modification of these records is not allowed.If other transactions want to acquire the corresponding X lock or, they will be blocked until the corresponding record X lock is released after the current transaction is committed.
SELECT * FROM UPDATE
- DELETE operation: The process of performing a DELETE operation on a record is actually to first locate the position of the record in the B+ tree, then acquire the X lock of this record, and then perform the DELETE Mark operation (It can be simply understood as a lock read that acquires an X lock)
- UPDATE operation: UPDATE operation on a record is divided into 3 cases
- If the key value of the record has not been modified and the storage space occupied by the updated column has not changed before and after the modification, locate in the B+ tree firstGo to the location of this record, then obtain the X lock of the record, and finally modify it at the location of the original record.(The process of locating the record to be modified in the B+ tree first, and then acquiring the X lock of the record can be regarded as a lock read that acquires the X lock)
- If the key value of the record has not been modified and the storage space occupied by at least one updated column has changed before and after modification, locate this record in the B+ tree first.The location of the record, then obtain the X lock of the record, then delete the record completely (move the record into the garbage list completely), and finally insert a new record.(First locate the record to be modified and then the position in the B+ tree, and then then acquire the X lock of the record. It can be seen as a locked read that acquires the X lock, strong>The lock on the record associated with the completely deleted record will also be transferred to the newly inserted record)
- If the key value of the record is modified, it is equivalent to performing an INSERT operation after the DELETE operation on the original record, and the locking operation needs to be performed according to the rules of DELETE and INSETR
- INSERT operation: Under normal circumstances, a newly inserted record is protected by an implicit lock, and there is no need to generate a corresponding lock structure for it in memory.
边栏推荐
- 【kali-信息收集】(1.4)识别活跃的主机/查看打开的端口:Nmap(网络映射器工具)
- 为你的“架构”安排定期体检吧!
- WhatsApp group sending actual combat sharing - WhatsApp Business API account
- 锐捷交换机基础配置
- Redis 做签到统计
- Win10, the middle mouse button cannot zoom in and out in proe/creo
- 即时通讯开发移动端弱网络优化方法总结
- regular expression
- 网络不通?服务丢包?这篇 TCP 连接状态详解及故障排查,收好了~
- LabVIEW 使用VISA Close真的关闭COM口了吗
猜你喜欢
30-day question brushing plan (5)
Does LabVIEW really close the COM port using VISA Close?
Greenplum数据库源码分析——Standby Master操作工具分析
57: Chapter 5: Develop admin management services: 10: Develop [get files from MongoDB's GridFS, interface]; (from GridFS, get the SOP of files) (Do not use MongoDB's service, you can exclude its autom
第56章 业务逻辑之物流/配送实体定义
XSS靶场中级绕过
终于有人把AB实验讲明白了
How PROE/Croe edits a completed sketch and brings it back to sketching state
面试突击70:什么是粘包和半包?怎么解决?
我的驾照考试笔记(2)
随机推荐
XSS靶场中级绕过
57:第五章:开发admin管理服务:10:开发【从MongoDB的GridFS中,获取文件,接口】;(从GridFS中,获取文件的SOP)(不使用MongoDB的服务,可以排除其自动加载类)
第57章 业务逻辑之业务实体与数据库表的映射规则定义
用户体验好的Button,在手机上不应该有Hover态
【节能学院】推进农业水价综合改革的意见解读
KDD2022 | 自监督超图Transformer推荐系统
第59章 ApplicationPart内置依赖注入中间件
CMake教程——Leeds_Garden
Combining two ordered arrays
Intranet penetration lanproxy deployment
卷积神经网络(CNN)mnist数字识别-Tensorflow
经验共享|在线文档协作:企业文档处理的最佳选择
【ES】ES2021 我学不动了,这次只学 3 个。
实用新型专利和发明专利的区别?秒懂!
datax - 艰难debug路
洛谷 P2440 木材加工
17、负载均衡
18. Distributed configuration center nacos
Win10, the middle mouse button cannot zoom in and out in proe/creo
Risc-v Process Attack