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 情况下一次就行了,看图

      

    ----

  • 相关阅读:
    OpenCV 最小二乘拟合方法求取直线倾角
    BFS-hdu-4101-Ali and Baba
    手机安全卫士开发系列(1)——功能列表
    【Linux常用工具】1.1 diff命令的三种格式
    手机安全卫士开发系列(2)——splash界面
    Ruby学习笔记(二)
    jQuery Animation实现CSS3动画
    HDU2699+Easy
    android中解析文件的三种方式
    查找某元素
  • 原文地址:https://www.cnblogs.com/JiangLe/p/7674017.html
Copyright © 2011-2022 走看看