mysql表字段太多性能影响_详解mysql数据库double write原理、性能影响及相关参数...

本文详细解析MySQL的double write机制,旨在解决partial page write问题,确保数据完整性。double write先将脏页写入共享表空间的特殊区域,再写入实际位置,从而在系统崩溃后能通过检查点和redo log恢复数据。虽然增加了一些fsync操作,但主要是顺序写,对性能影响有限。文章还讨论了double write的相关参数和是否必须启用的情况。
摘要由CSDN通过智能技术生成

概述

今天主要介绍下mysql一个崩溃恢复很重要的特性--double write.

The doublewrite buffer is a storage area located in the system tablespace where InnoDB writes pages that are flushed from the InnoDB buffer pool, before the pages are written to their proper positions in the data file. Only after flushing and writing pages to the doublewrite buffer, does InnoDB write pages to their proper positions. If there is an operating system, storage subsystem, or mysqld process crash in the middle of a page write, InnoDB can later find a good copy of the page from the doublewrite buffer during crash recovery.


一、partial page write 问题

InnoDB 的Page Size一般是16KB,其数据校验也是针对这16KB来计算的,将数据写入到磁盘是以Page为单位进行操作的。而计算机硬件和操作系统,在极端情况下(比如断电)往往并不能保证这一操作的原子性,16K的数据,写入4K 时,发生了系统断电/os crash ,只有一部分写是成功的,这种情况下就是 partial page write 问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值