英宁
2016-02-20 10:17
好像都是一秒以后刷新到磁盘,是2会先刷到缓存里么,那0的时候一秒以后直接刷磁盘?
0和2都是每秒从缓冲区写入文件一次。区别是commit操作时,0不做任何操作,为2 的时候,commit时会把缓冲区内容写入文件。文档上是这么写的:If the value of innodb_flush_log_at_trx_commit is 0, the log buffer is written out to the log file once per second and the flush to disk operation is performed on the log file, but nothing is done at a transaction commit.. When the value is 2, the log buffer is written out to the file at each commit, but the flush to disk operation is not performed on it. However, the flushing on the log file takes place once per second also when the value is 2.
0是每秒刷一次磁盘,1是每一个事务提交后都要刷一次磁盘,2是提交事务后记录但是不刷盘。
性能优化之MySQL优化
101664 学习 · 221 问题
相似问题