oracle的group by用法,mysql-5.7 group commit 詳解

 2023-11-19 阅读 24 评论 0

摘要:一、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 o

一、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 情況下一次就行了,看圖

  

?

?

?

----

轉載于:https://www.cnblogs.com/JiangLe/p/7674017.html

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/1/179803.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息