当前位置:网站首页>Brief introduction to mvcc
Brief introduction to mvcc
2022-07-03 12:50:00 【Mcc_ mingchao】
MVCC(Multi-Version Concurrency Control) Multi version concurrent control .
We are learning about MVCC Before , First, let's learn about some common locks .
Read the lock : Also called Shared locks 、S lock , If business T For data objects A add S lock , The transaction T You can read A But it can't be modified A, Other affairs can only be right again A Add S lock , Instead of X lock , until T Release A Upper S lock . This ensures that other things can be read A, But in T Release A Upper S You can't do it before you lock it A Make any changes .
Write lock : It's also called exclusive lock 、X lock . If business T For data objects A add X lock , Business T You can read A You can also modify A, Other affairs can no longer be right A Add any locks , until T Release A The lock on the . This ensures that the rest of the business is T Release A The lock on can't be read or modified before A.
Table locks : The object of operation is the data table .Mysql Most lock strategies support , It is a locking strategy with the lowest system overhead but the lowest concurrency . Business t Lock the whole watch , Other transactions are readable and not writable , If write lock is added , Then the addition, deletion and modification of other affairs are not allowed .
Row-level locks : The operand is a row in the data table . yes MVCC Technology is used more . Row level lock has a high cost to the system , But it's better to deal with high concurrency .
MVCC Most transaction engines that support row locking , No longer simply use row lock to control database concurrency , Instead, combine the row lock of the database with multiple versions of the row , It's just a small expense , You can read without locking , So as to greatly improve the concurrency performance of the database system .
MVCC working process
InnoDB Of MVCC, This is achieved by saving two hidden columns behind each row of records . These two columns , A created version number that holds the line , A deleted version number that saves the row . Every time you start a new business , The system version number will increase automatically . The system version number at the start of the transaction will be the version number of the transaction , It is used to compare with the version number of each line of records found .
Innodb Hidden columns in
Innodb adopt undo log Save a snapshot of the information of the old version of the changed row . InnoDB Three hidden columns are added for each row of data in the internal implementation of MVCC.

边栏推荐
- 并网-低电压穿越与孤岛并存分析
- 剑指Offer09. 用两个栈实现队列
- 剑指Offer05. 替换空格
- How to convert a decimal number to binary in swift
- 【综合题】【数据库原理】
- Swift Error Handling
- [review questions of database principles]
- initial、inherit、unset、revert和all的区别
- The future of cloud computing cloud native
- (latest version) WiFi distribution multi format + installation framework
猜你喜欢

剑指Offer04. 二维数组中的查找【中等】

Analysis of the influence of voltage loop on PFC system performance

Day 1 of kotlin learning: simple built-in types of kotlin

(latest version) WiFi distribution multi format + installation framework

Sword finger offer05 Replace spaces

Attack and defense world mobile--ph0en1x-100

Solve the problem of VI opening files with ^m at the end

电压环对 PFC 系统性能影响分析
![Sword finger offer03 Repeated numbers in the array [simple]](/img/cf/c1ad2f2a45560b674b5b8c11fed244.png)
Sword finger offer03 Repeated numbers in the array [simple]
![[problem exploration and solution of one or more filters or listeners failing to start]](/img/82/e7730d289c4c1c4800b520c58d975a.jpg)
[problem exploration and solution of one or more filters or listeners failing to start]
随机推荐
Use Tencent cloud IOT platform to connect custom esp8266 IOT devices (realized by Tencent continuous control switch)
Using swift language features, write a pseudo-random number generator casually
Seven second order ladrc-pll structure design of active disturbance rejection controller
【计网】第三章 数据链路层(2)流量控制与可靠传输、停止等待协议、后退N帧协议(GBN)、选择重传协议(SR)
LeetCode 0556. Next bigger element III - end of step 4
最新版盲盒商城thinkphp+uniapp
idea将web项目打包成war包并部署到服务器上运行
【ManageEngine】IP地址扫描的作用
Sword finger offer09 Implementing queues with two stacks
Alibaba is bigger than sending SMS (user microservice - message microservice)
Powerful avatar making artifact wechat applet
flinksql是可以直接客户端建表读mysql或是kafka数据,但是怎么让它自动流转计算起来呢?
Use bloc to build a page instance of shutter
基于同步坐标变换的谐波电流检测
Approve iPad, which wants to use your icloud account
The future of cloud computing cloud native
阿里大于发送短信(用户微服务--消息微服务)
The latest version of blind box mall thinkphp+uniapp
剑指Offer10- I. 斐波那契数列
studio All flavors must now belong to a named flavor dimension. Learn more