Home  >  Q&A  >  body text

lock - mysql中的next key与mvcc有何不同?各自的应用体现在哪?

看一些文章提到,mysql中INNODB引擎的表采用mvcc机制来解决幻读问题。但next key lock也是用于解决幻读,弄不清这两个到底区别在哪?

PHP中文网PHP中文网2743 days ago698

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-04-17 12:00:39

    The ideal MVCC can solve phantom reading, but what innodb actually implements is not the ideal MVCC.
    Innodb really relies on next key lock to solve phantom reads. Because innodb's write operation is actually an exclusive lock operation, the actual implementation of MVCC is used to solve the read concurrency problem.

    I finally understood it after reading this link, so I attached it directly
    http://blog.csdn.net/chen77716/article/details/6742128

    reply
    0
  • Cancelreply