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的更多相关文章

  1. MySQL 5.5: InnoDB Change Buffering

    To speed up bulk loading of data, InnoDB implements an insert buffer, a special index in the InnoDB ...

  2. [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变成默认 ...

  3. (转)mysql各个主要版本之间的差异

    原文:http://blog.csdn.net/z1988316/article/details/8095407   一.各版本的常用命令差异 show innodb status\G mysql-5 ...

  4. MySQL版本调研

    1引言 1.1 编写目的 本文的主要目的是通过对当前项目中使用的各种版本的数据库进行比较,分析各自特性和稳定程度,最终推荐合适的版本作为今后的标准数据库. 1.2 背景 当前,部门负责管理维护的现网使 ...

  5. InnoDB关键特性之change buffer

    一.关于IOT:索引组织表 表在存储的时候按照主键排序进行存储,同时在主键上建立一棵树,这样就形成了一个索引组织表,一个表的存储方式以索引的方式来组织存储的. 所以,MySQL表一定要加上主键,通过主 ...

  6. RDS最佳实践(一)—如何选择你的RDS

    在去年双11之前,为了帮助商家准备天猫双11的大促,让用户更好的使用RDS,把RDS的性能发挥到最佳,保障双11当天面对爆发性增加的压力,不会由于RDS的瓶颈导致系统出现问题,编写了 RDS的最佳实践 ...

  7. 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 ...

  8. MySQL -- Innodb中的change buffer

    change buffer是一种特殊的数据结构,当要修改的辅助索引页不在buffer pool中时,用来cache对辅助索引页的修改.对辅助索引页的操作可能是insert.update和delete操 ...

  9. MYSQL的历史

    MYSQL的历史 见证MySQL发展历程 各分支版本溯源 http://tech.it168.com/a2012/0621/1363/000001363446.shtml [IT168 技术]毫无疑问 ...

随机推荐

  1. centos下nginx启动脚本和chkconfig管理

    在安装完nginx后,重新启动需要“kill -HUP nginx进程编号”来进行重新加载,显然十分不方便.如果能像apache一样,直接通过脚本进行管理就方便多了. nginx官方早就想好了,也提供 ...

  2. SVN checkout 功能不可用 右键只看到提交和更新,没有显示checkout

    不要在受SVN控制的文件夹里点右键,因为这个文件夹已经在SVN控制之下,当然不会允许在里面嵌套另一个SVN版本库换个不受控的文件夹点右键,比如D盘根目录

  3. java 中 HashMap 遍历与删除

    HashMap的遍历 方法一.这是最常见的并且在大多数情况下也是最可取的遍历方式 /** * 在键值都需要时使用 */ Map<Integer, Integer> map = new Ha ...

  4. 203. Remove Linked List Elements【easy】

    203. Remove Linked List Elements[easy] Remove all elements from a linked list of integers that have ...

  5. python学习之lambda()

    中学时期,数学老师不时在口中说着:“拉姆达!λ...”.这里的“拉姆达”表示第十一个希腊字母. 而在python中,lambda表示匿名函数. 先来看看匿名函数 >>> f = la ...

  6. oracle中查看sql语句的执行计划

    1.在pl/sql中打开cmd命令容器 2.在cmd命令窗口中输入:explain plan for select * from t; 3.查看sql语句的执行计划:select * from tab ...

  7. 解决 ios7.0 以后自定义导航栏左边按钮靠右的问题

    解决 ios7.0 以后自定义导航栏左边按钮靠右的问题 www.111cn.net 编辑:edit02_lz 来源:转载 最近开发了一个ios的app,在ios7.0+出现自定义导航栏左边按钮出现靠右 ...

  8. [搬家]新域名 akagi201.org

    现在感觉自己做了好多年的垃圾信息制造者 以后只在网络上发布有用的东西, 垃圾或者对别人没用的东西就放到自己的硬盘上把 http://akagi201.org

  9. 利用JNDI的命名与服务功能来满足企业级API对命名与服务的访问

    包含了大量的命名和目录服务,使用通用接口来访问不同种类的服务: 可以同时连接到多个命名或目录服务上: 建立起逻辑关联,允许把名称同Java对象或资源关联起来,而不必知道对象或资源的物理ID. JNDI ...

  10. Win10中配置jdk之后javac无法运行

    环境变量(environment variables)一般是指在操作系统中用来指定操作系统运行环境的一些参数,如:临时文件夹位置和系统文件夹位置等. 环境变量是在操作系统中一个具有特定名字的对象,它包 ...