Two blogs that explain the principle of MySQL MVCC mechanism clearly

After reading a few blogs, the first one was written more carefully and basically solved my doubts. Of course, this is not to say that this article is perfect. The visibility comparison algorithm of MVCC's ReadView is still the same as other blogs on the Internet, with errors. Finally, I read the second blog , which combined the source code for corroboration, which is more correct.
Finally, briefly summarize MVCC:
MVCC is a means to improve concurrency technology. If there is no MVCC, then MySQL must add x/s locks to achieve RC/RR. At this time, reading, writing, reading, and writing are all blocking each other. With MVCC, only writing conflicts, which improves concurrency performance.
Regarding the implementation mechanism, it is mainly implemented through the undo log. Each update will create a snapshot and store it in the undo log, and then create a ReadView when reading it to determine which version of the snapshot is visible to the current transaction. The specific algorithm still depends on the second blog. RC isolation level, each select statement of a transaction will create a ReadView, RR isolation level of the entire transaction will only create a ReadView.

Guess you like

Origin blog.csdn.net/Fei20140908/article/details/108330352