Insert Buffering
14.5.13.4 Insert Buffering
Database applications often insert new rows in the ascending order of the primary key. In this case, due to the layout
of the clustered index in the same order as the primary key, insertions into an InnoDB table do not require random reads
from a disk.
On the other hand, secondary indexes are usually nonunique, and insertions into secondary indexes happen in a relatively
random order. In the same way, deletes and updates can affect data pages that are not adjacent in secondary indexes. This
would cause a lot of random disk I/O operations without a special mechanism used in InnoDB.
When an index record is inserted, marked for deletion, or deleted from a nonunique secondary index, InnoDBchecks whether
the secondary index page is in the buffer pool. If that is the case, InnoDB applies the change directly to the index page. If the
index page is not found in the buffer pool, InnoDB records the change in a special structure known as the insert buffer. The insert
buffer is kept small so that it fits entirely in the buffer pool, and changes can be applied very quickly. This process is known
as change buffering. (Formerly, it applied only to inserts and was called insert buffering. The data structure is still called the insert
buffer.)
Disk I/O for Flushing the Insert Buffer
Periodically, the insert buffer is merged into the secondary index trees in the database. Often, it is possible to merge several
changes into the same page of the index tree, saving disk I/O operations. It has been measured that the insert buffer can speed
up insertions into a table up to 15 times.
The insert buffer merging may continue to happen after the transaction has been committed. In fact, it may continue to
happen after a server shutdown and restart (see Section 14.21.2, “Starting InnoDB on a Corrupted Database”).
Insert buffer merging may take many hours when many secondary indexes must be updated and many rows have been
inserted. During this time, disk I/O will be increased, which can cause significant slowdown on disk-bound queries. Another
significant background I/O operation is the purge thread (see Section 14.5.12, “InnoDB Multi-Versioning”).
Insert Buffering的更多相关文章
- MySQL 5.5: InnoDB Change Buffering
To speed up bulk loading of data, InnoDB implements an insert buffer, a special index in the InnoDB ...
- [MySQL Reference Manual]14 InnoDB存储引擎
14 InnoDB存储引擎 14 InnoDB存储引擎 14.1 InnoDB说明 14.1.1 InnoDB作为默认存储引擎 14.1.1.1 存储引擎的趋势 14.1.1.2 InnoDB变成默认 ...
- (转)mysql各个主要版本之间的差异
原文:http://blog.csdn.net/z1988316/article/details/8095407 一.各版本的常用命令差异 show innodb status\G mysql-5 ...
- MySQL版本调研
1引言 1.1 编写目的 本文的主要目的是通过对当前项目中使用的各种版本的数据库进行比较,分析各自特性和稳定程度,最终推荐合适的版本作为今后的标准数据库. 1.2 背景 当前,部门负责管理维护的现网使 ...
- InnoDB关键特性之change buffer
一.关于IOT:索引组织表 表在存储的时候按照主键排序进行存储,同时在主键上建立一棵树,这样就形成了一个索引组织表,一个表的存储方式以索引的方式来组织存储的. 所以,MySQL表一定要加上主键,通过主 ...
- RDS最佳实践(一)—如何选择你的RDS
在去年双11之前,为了帮助商家准备天猫双11的大促,让用户更好的使用RDS,把RDS的性能发挥到最佳,保障双11当天面对爆发性增加的压力,不会由于RDS的瓶颈导致系统出现问题,编写了 RDS的最佳实践 ...
- MySQL 4.1-5.0-5.1-5.5-5.6各版本的主要区别
各版本的一些命令差异: show innodb status\G mysql-5.1 show engines innodb status\G mysql-5.5 关于grant授权 mysql ...
- MySQL -- Innodb中的change buffer
change buffer是一种特殊的数据结构,当要修改的辅助索引页不在buffer pool中时,用来cache对辅助索引页的修改.对辅助索引页的操作可能是insert.update和delete操 ...
- MYSQL的历史
MYSQL的历史 见证MySQL发展历程 各分支版本溯源 http://tech.it168.com/a2012/0621/1363/000001363446.shtml [IT168 技术]毫无疑问 ...
随机推荐
- Android内存优化大全(中)
转载请注明本文出自大苞米的博客(http://blog.csdn.net/a396901990),谢谢支持! 写在最前: 本文的思路主要借鉴了2014年AnDevCon开发者大会的一个演讲PPT,加上 ...
- should + mocha 搭建简单的单元测试环境
快速搭建测试环境,详细用法请百度和访问两者的github mocha: http://mochajs.org/ should: https://github.com/shouldjs/should.j ...
- 光栅化规则(Rasterization Rules)
光栅化规则不是唯一的,只要能满足在扫描线填充过程中,对于一条分割线两边的像素能够被不重复不遗漏地填充即可. 在gdi3d中目前使用的是下面光栅化规则: xLeft_int=ceil(xLeft-0.5 ...
- iOS-Gif图片展示N种方式(原生+第三方)
原生方法: 1.UIWebView 特点:载入速度略长,性能更优.播放的gif动态图更加流畅. //动态展示GIF图片-WebView -(void)showGifImageWithWebView{ ...
- RapidIO协议(1)
RapidIO协议 1.概述 1.1介绍 RapidIO是基于包交换互联协议,主要作为系统内部接口使用,如:芯片间.板间的通讯,速度能在GB/S数量级.如连接处理器.内存.内存映射的I/O设备.这些设 ...
- 配置Redmine的邮件通知功能
依据<Windows下安装Redmine 2.5.2不全然指南 >一文,我们搭建主要的 Redmine 平台.如今是时候做进一步的配置了. 作为一个项目管理平台,必须能够通知项目成员有关项 ...
- inode表元数据,存储在物理存储体上
一个文件除了数据需要存储之外,一些描述信息也需要存储,例如文件类型(常规.目录.符号链接等),权限,文件大小,创建/修改/访问时间等,也就是ls -l命令看到的那些信息,这些信息存在inode中而不是 ...
- Spark Core源代码分析: RDD基础
RDD RDD初始參数:上下文和一组依赖 abstract class RDD[T: ClassTag]( @transient private var sc: SparkContext, @tran ...
- 导入mysql文件提示“ASCII '\0' appeared in the statement”
在windows服务器上导入mysql文件时,出现以下报错:ASCII '\0' appeared in the statement, but this is not allowed unless o ...
- ThinkPHP与EasyUI整合之二(datagrid):删除多条记录
学习EasyUI已有一段时间了,现在开始逐步把平时学习的细节和难点记录下来. 1. datagrid选中多条记录的语句是: var rows = $('#dg').datagrid('getSelec ...