zoukankan      html  css  js  c++  java
  • [MySQL] 事务隔离级别

    DataBase Isolation Levels

    隔离级别以及对应级别存在问题

    Isolation Level/Problem P0
    Dirty Write
    P1
    Dirty Read
    P4C
    Cursor Lose Update
    P4
    Lose Update
    p2
    Fuzzy Read
    P3
    Phantom
    A5A
    Read Skew
    A5B
    Write Skew
    Read Uncommitted Not Possible Possible Possible Possible Possible Possible Possible Possible
    Read Committed Not Possible Not Possible Possible Possible Possible Possible Possible Possible
    Cursor Stabillity Not Possible Not Possible Not Possible Possible Possible Possible Possible Possible
    Repeatable Read Not Possible Not Possible Not Possible Not Possible Not Possible Possible Not Possible Not Possible
    Snapshot Not Possible Not Possible Not Possible Not Possible Not Possible Possible Not Possible Possible
    Serializable Not Possible Not Possible Not Possible Not Possible Not Possible Not Possible Not Possible Not Possible

    隔离级别由弱到强

    Degree 0 (everything goes) << Read Uncommitted << Read Committed << Cursor Stability << Repeatable Read << Serializable

    这里还有其他2种隔离级别: <font color="green", size="5">Oracle Consistency Read和Snapshot Isolation, Read Committed << Oracle Consistent Read,
    Read Committed << Snapshot Isolation << Serializable,
    这2种隔离级别都是多版本并发控制机制.

    Snapshot Isolation和Repeatable Read并不是对等的, 前者可以防止写偏序(Write Skew), 而Repeatable Read可以防止Snapshot Isolation情况下的一些不能防止的幻读(Phantoms)问题.

    隔离级别总结

  • 相关阅读:
    bzoj3993: [SDOI2015]星际战争
    bzoj3583: 杰杰的女性朋友 && 4362: Graph
    bzoj2260: 商店购物 && 4349: 最小树形图
    老oj3444 && Pku3241 Object Clustering
    bzoj3754: Tree之最小方差树
    bzoj2215: [Poi2011]Conspiracy
    老oj曼哈顿最小生成树
    bzoj2180: 最小直径生成树
    棋盘问题
    油田 Oil Deposits
  • 原文地址:https://www.cnblogs.com/renolei/p/5225488.html
Copyright © 2011-2022 走看看