当前位置:网站首页>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.
边栏推荐
- 密码学的基础:X.690和对应的BER CER DER编码
- 【nn.Parameter()】生成和为什么要初始化
- MongoDB快速上手
- MySQL你到底都加了什么锁?
- Mobile Zero of Likou Brush Questions
- 【kali-信息收集】(1.4)识别活跃的主机/查看打开的端口:Nmap(网络映射器工具)
- WhatsApp group sending actual combat sharing - WhatsApp Business API account
- 第55章 业务逻辑之订单、支付实体定义
- Pytorch模型训练实用教程学习笔记:四、优化器与学习率调整
- 专利检索常用的网站有哪些?
猜你喜欢

【kali-信息收集】(1.3)探测网络范围:DMitry(域名查询工具)、Scapy(跟踪路由工具)

【个人作品】无线网络图传模块

我的驾照考试笔记(2)

Arthas 常用命令

经验共享|在线文档协作:企业文档处理的最佳选择

How PROE/Croe edits a completed sketch and brings it back to sketching state

nacos安装与配置

MongoDB快速上手

【kali-信息收集】(1.2)SNMP枚举:Snmpwalk、Snmpcheck;SMTP枚举:smtp-user-enum

卷积神经网络(CNN)mnist数字识别-Tensorflow
随机推荐
八百客、销售易、纷享销客各行其道
泰德制药董事长郑翔玲荣膺“2022卓越影响力企业家奖” 泰德制药荣获“企业社会责任典范奖”
Does LabVIEW really close the COM port using VISA Close?
Creo5.0草绘如何绘制正六边形
为什么限制了Oracle的SGA和PGA,OS仍然会用到SWAP?
【节能学院】智能操控装置在高压开关柜的应用
实用新型专利和发明专利的区别?秒懂!
第56章 业务逻辑之物流/配送实体定义
30天刷题计划(五)
密码学的基础:X.690和对应的BER CER DER编码
给定中序遍历和另外一种遍历方法确定一棵二叉树
密码学的基础:X.690和对应的BER CER DER编码
MongoDB快速上手
Compse编排微服务实战
【kali-信息收集】(1.2)SNMP枚举:Snmpwalk、Snmpcheck;SMTP枚举:smtp-user-enum
我的驾照考试笔记(3)
多线程之生产者与消费者
【ES】ES2021 我学不动了,这次只学 3 个。
漏刻有时文档系统之XE培训系统二次开发配置手册
【多任务模型】Progressive Layered Extraction: A Novel Multi-Task Learning Model for Personalized(RecSys‘20)