当前位置:网站首页>Transaction of MySQL underlying principle (2)
Transaction of MySQL underlying principle (2)
2022-07-28 12:58:00 【It dongdongge】
One 、 Basic concepts of business
1、 Transaction features :
- A(Atomicity Atomicity ): All success or all failure
- I(Isolation Isolation, ): Parallel transactions do not interfere with each other
- D(Durability persistence ): After the transaction is committed , permanent
- C(Consistency Uniformity ): adopt AID Guarantee
2、 Concurrency issues :
- Dirty reading (Drity Read): Read uncommitted data
- It can't be read repeatedly (Non-repeatable read): The results of the two readings are different
- Fantasy reading (Phantom Read):select The data state represented by the result of the operation cannot support the subsequent business operation
3、 Isolation level :
- Read Uncommitted( Read uncommitted content ): Minimum isolation level , Will read uncommitted data from other transactions , Dirty reading ;
- Read Committed( Read submissions ): Data submitted by other transactions can be read during the transaction , It can't be read repeatedly ;
- Repeatable Read( Repeatable ): Read the same result set every time , Whether other transactions are committed or not , Fantasy reading ;
- Serializable( Serialization ): Transaction queuing , The highest level of isolation , The worst performance ;
Two 、 How things work
1、MVCC
- Multi version concurrency control —— The current reading + Snapshot degree : Solved the read-write conflict , As long as I read Data of one version , No matter how other transactions are modified , It has nothing to do with the version I read , Because what I read is a snapshot . Combined with the figure below .

- Predictability judgment :
l The moment you create a snapshot , Uncommitted transactions are not visible ;
l Transactions created after snapshots are not visible ;
- Read View:
l Read the snapshot Active transaction list 【10,11,15,17】
l The smallest transaction in the list ID
l The largest transaction in the list ID

2、undo log: Multiple versions exist here

- Rollback log
- Ensure transaction atomicity
- Realize multi version of data
- delete undo log: For rollback , Clean up upon submission ;
- update undo log: For rollback , At the same time, realize snapshot reading , You can't delete
- clear undo log: According to the minimum active transactions of the system ID Read view
3、redo log: Achieve transaction persistence
- Record changes
- For exception recovery
- Loop write file

- Write process

- When to brush the disk :2=> Memory brush of operating system

- significance :a、 Small volume , Modification of record page , Less expensive than writing pages
b、 Append at the end , Write in random order , The changed page is not fixed
边栏推荐
- How to add PDF virtual printer in win11
- 机器学习实战-神经网络-21
- Insufficient permission to pull server code through Jenkins and other precautions
- 区块反转(暑假每日一题 7)
- leetcode 376. Wiggle Subsequence
- Leetcode206 reverse linked list
- Huawei cloud Gao Hongxia: CBC microservice code Reconstruction & independent release practice
- Unity loads GLB model
- C# 结构使用
- What if the win11 folder cannot be opened
猜你喜欢

线性分类器(CCF20200901)

Machine learning practice - integrated learning-23

连通块&&食物链——(并查集小结)

Kotlin是如何帮助你避免内存泄漏的?

Leetcode 1518. wine change

01 introduction to pyechars features, version and installation

03 pyechars 直角坐标系图表(示例代码+效果图)

机器学习基础-主成分分析PCA-16
![[pictures and texts] detailed tutorial of one click reinstallation of win11 system](/img/cc/749fe4095fc5afb1fc2c65df43d06c.png)
[pictures and texts] detailed tutorial of one click reinstallation of win11 system

Leetcode:704 binary search
随机推荐
Xampp Chinese tutorial guide
Machine learning practice - decision tree-22
Force buckle 315 calculates the number of elements smaller than the current element on the right
Summary: idea problem record
leetcode 1518. 换酒问题
Kotlin是如何帮助你避免内存泄漏的?
Connected Block & food chain - (summary of parallel search set)
How to open the power saving mode of win11 system computer
Leetcode394 string decoding
What if win11 cannot recognize Ethernet
leetcode 376. Wiggle Subsequence
XIII Actual combat - the role of common dependence
MMA8452Q几种模式的初始化实例
Zurich Federal Institute of technology | reference based image super resolution with deformable attention transformer (eccv2022))
Science heavyweight: AI design protein has made another breakthrough, and it can design specific functional proteins
VS code更新后不在原来位置
单调栈Monotonic Stack
STM32F103 several special pins are used as ordinary io. Precautions and data loss of backup register 1,2
Vs code is not in its original position after being updated
LeetCode206 反转链表