V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zxCoder
V2EX  ›  问与答

请教一下 PostgreSQL 中的 serialization anomaly 是什么意思

  •  
  •   zxCoder · 2021-02-08 13:56:32 +08:00 · 758 次点击
    这是一个创建于 1187 天前的主题,其中的信息可能已经有所发展或是发生改变。

    谷歌也没查到太多相关的

    文档的定义是

    The result of successfully committing a group of transactions is inconsistent with all possible orderings of running those transactions one at a time.
    

    翻译过来我还是不太能理解,

    成功提交一组事务的结果 和 以所有可能的顺序去依次提交这些事务的结果 不一致?

    这是什么意思?

    提交一组事务(committing a group of transactions)难道不也是一个一个提交的吗?

    2 条回复    2021-02-08 19:11:10 +08:00
    sfqtsh
        1
    sfqtsh  
       2021-02-08 16:52:27 +08:00 via Android
    你看下,
    http://wiki.postgresql.org/wiki/SSI
    里面提到有很多例子,再结合博客园里的一篇
    https://www.cnblogs.com/ivan-uno/p/8274355.html

    "anomaly" 就是指类似 write skew 这种现象的发生。像 write skew,如果是真正的时间上的串行化来先后执行的话(不管谁先谁后),它是不可能发生的 (你看两个链接里都提到的改颜色例子)。

    你既然问的是事务隔离级别相关,"一组事务"肯定说的 concurrent 事务了,出于效率,可串行化隔离级别的[实现]又不是真的"一个个先后执行"。
    zxCoder
        2
    zxCoder  
    OP
       2021-02-08 19:11:10 +08:00
    @sfqtsh 谢谢 我再理解一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   979 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:43 · PVG 05:43 · LAX 14:43 · JFK 17:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.