当前位置:网站首页>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.
边栏推荐
- Lambda expression
- 最新版抽奖盲盒运营版
- 十条职场规则
- [embedded] - Introduction to four memory areas
- Exploration of sqoop1.4.4 native incremental import feature
- Tensorflow binary installation & Failure
- CNN MNIST handwriting recognition
- Sword finger offer04 Search in two-dimensional array [medium]
- Detailed explanation of the most complete constraintlayout in history
- Integer case study of packaging
猜你喜欢
剑指Offer10- I. 斐波那契数列
[problem exploration and solution of one or more filters or listeners failing to start]
Analysis of a music player Login Protocol
剑指Offer06. 从尾到头打印链表
Method overloading and rewriting
Public and private account sending prompt information (user microservice -- message microservice)
Xctf mobile--app3 problem solving
强大的头像制作神器微信小程序
Ali & ant self developed IDE
【综合题】【数据库原理】
随机推荐
初入职场,如何快速脱颖而出?
idea将web项目打包成war包并部署到服务器上运行
Xctf mobile--app2 problem solving
剑指Offer09. 用两个栈实现队列
elastic_ L01_ summary
Define a list, store n integers, and calculate the length, maximum value, minimum value and average value of the list
alright alright alright
elastic_ L04_ introduction. md
initial、inherit、unset、revert和all的区别
Swift Error Handling
Express abstract classes and methods
Xctf mobile--rememberother problem solving
Kotlin notes - popular knowledge points asterisk (*)
并网-低电压穿越与孤岛并存分析
Record your vulnhub breakthrough record
【计网】第三章 数据链路层(2)流量控制与可靠传输、停止等待协议、后退N帧协议(GBN)、选择重传协议(SR)
Sqoop1.4.4原生增量导入特性探秘
Applet wxss introduction
[exercice 7] [principe de la base de données]
【习题五】【数据库原理】