本文主要是介绍书生笔记-Binlog Cache解析,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
整个事务的Event在commit的时候才会真正的写入到binlog 文件中,在此之前,这些Event 都放在binlog cache中。
先来看下几个相关参数的定义binlog_cache_size,
binlog_stmt_cache_size。
-
binlog_cache_size
The size of the memory buffer to hold changes to the binary log during a transaction. When binary logging is enabled on the server (with the
log_bin
system variable set to ON), a binary log cache is allocated for each client if the server supports any transactional storage engines. If the data for the transaction exceeds the space in the memory buffer, the excess data is stored in a temporary file. When binary log encryption is active on the server, the memory buffer is not encrypted, but (from MySQL 8.0.17) any temporary file used to hold the binary log cache is encrypted. After each transaction is committed, the binary log cache is reset by clearing the memory buffer and truncating the temporary file if used.
指的是事务的改变,在写到binlog文件之前,存放的内存区域大小。如果数据的大小超过了这个内存大小设置,超出的数据将会被存储到临时文件中。在binlog文件启用加密时,内存buffer区域是不加密的,但是从MySQL8.0.17开始,任何临时文件持有的binlog cache都将会被加密,在每一个事务提交后,binlog cache将会被reset重置
这篇关于书生笔记-Binlog Cache解析的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!