zoukankan      html  css  js  c++  java
  • mysql-5.7 group commit 详解

    一、mysql group commit 的官方定义:

    InnoDB, like any other ACID-compliant database engine, flushes the redo log of a transaction before it is committed. InnoDB uses group commit functionality to group multiple such flush requests together to avoid one flush for each commit. With group commit, InnoDB issues a single write to the log file to perform the commit action for multiple user transactions that commit at about the same time, significantly improving throughput.

    An InnoDB optimization that performs some low-level I/O operations (log write) once for a set of commit operations, rather than flushing and syncing separately for each commit.

      

      参考连接:

        https://dev.mysql.com/doc/refman/5.7/en/innodb-performance-group_commit.html

        https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_group_commit

    二、翻译一下

      innodb 和所有支持acid属性的引擎一样,提交得以完成的条件是事务相关的redo log 都刷新到了磁盘,innodb 使用组提交

      的方式把多个刷新操作组织到一起,这样就避免为每一个commit发起一个刷新操作,而是多个commit共用一个刷新。

    三、group commit 的原理:

      为了说明innodb group commit的原理,我在这里假设一个有3个事务同时运行

      a事务从t0 时刻开始运行,到t1时刻完成的操作,t9的时间收到了commit指令

      b事务从t1 时刻开始运行,到t2时刻完成的操作,t8的时间收到了commit指令

      c事务从t3 时刻开始运行,到t4时刻完成的操作,t5的时间收到了commit指令

      传统模式下三个commit对应三次刷新操作,但是在group commit 情况下一次就行了,看图

      

    ----

  • 相关阅读:
    windows server 2008 R2下如何快速开启远程桌面、1433、telnet
    利用Lambda获取类中属性名称
    EntityFramework之迁移操作(五)
    EntityFramework之多对多关系(四)
    EntityFramework之一对多关系(三)
    EntityFramework之一对一关系(二)
    EntityFramework之创建数据库及基本操作(一)
    Javascript短路表达式
    Javascript中call、apply函数浅析
    Javascript"怪异"现象
  • 原文地址:https://www.cnblogs.com/JiangLe/p/7674017.html
Copyright © 2011-2022 走看看