8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

17.5.4 日志缓冲区17.5.4 Log Buffer

日志缓冲区是用于保存将写入磁盘日志文件的数据的内存区域。日志缓冲区的大小由 innodb_log_buffer_size 变量定义。默认大小为 64MB。日志缓冲区的内容会定期刷新到磁盘。较大的日志缓冲区允许大型事务运行而无需在事务提交之前将重做日志数据写入磁盘。因此,如果您有更新、插入或删除大量行的事务,增加日志缓冲区的大小可以节省磁盘 I/O。The log buffer is the memory area that holds data to be written to the log files on disk. Log buffer size is defined by the innodb_log_buffer_size variable. The default size is 64MB. The contents of the log buffer are periodically flushed to disk. A large log buffer enables large transactions to run without the need to write redo log data to disk before the transactions commit. Thus, if you have transactions that update, insert, or delete many rows, increasing the size of the log buffer saves disk I/O.

innodb_flush_log_at_trx_commit 变量控制日志缓冲区的内容如何写入并刷新到磁盘。innodb_flush_log_at_timeout 变量控制日志刷新频率。The innodb_flush_log_at_trx_commit variable controls how the contents of the log buffer are written and flushed to disk. The innodb_flush_log_at_timeout variable controls log flushing frequency.

有关相关信息,请参见 内存配置,以及 第 10.5.4 节,“优化 InnoDB 重做日志”。For related information, see Memory Configuration, and Section 10.5.4, “Optimizing InnoDB Redo Logging”.