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. springboot学习(八) 使用jpa访问数据库

    1.添加maven依赖 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connecto ...

  2. STM32 通用T2、T3、T4、T5定时器详解

    定时器初始化配置 void TIM3_Configuration(void)//1MS { TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; TIM_DeI ...

  3. caffe 中如何打乱训练数据

    第一: 可以选择在将数据转换成lmdb格式时进行打乱: 设置参数--shuffle=1:(表示打乱训练数据) 默认为0,表示忽略,不打乱. 打乱的目的有两个:防止出现过分有规律的数据,导致过拟合或者不 ...

  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. MySQL 中文显示乱码

    最近关于中文显示乱码的贴子比较多,所以也做了个总结: 可以参考一下杨涛涛版主的<各种乱码问题汇总> http://topic.csdn.net/u/20071124/08/3b7eae69 ...

  6. IOS设计模式的六大设计原则之依赖倒置原则(DIP,Dependence Inversion Principle)

    定义 高层模块不应该依赖于低层模块,二者都应该依赖于抽象:抽象不应该依赖细节:细节应该依赖抽象. 定义解读 依赖倒置原则在程序编码中经常运用,其核心思想就是面向接口编程,高层模块不应该依赖低层模块(原 ...

  7. 中移苏研DCOS实践之路完整篇

    一.实践背景 1.1现网生产系统存在的问题 在中国移动内部各省市公司,由于技术迭代.设备更新的原因,设备繁杂,有x86server .VMware虚拟机.OpenStack虚拟机以及不同厂商的物理机( ...

  8. 我的第六个java程序 spring-bean

    配置文件 Beans.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns=&quo ...

  9. c++标准库之thread

    class thread是对线程的抽象.以下分别介绍thread是如何表示线程的大部分特征的. 执行体 线程的执行体由一个可执行(callable)对象来表示.这个执行体可以在thread创建的时候指 ...

  10. Win10系统如何配置Tomcat环境变量

    我们知道win10用户在配置Tomcat环境变量的时候,首先需要配置JAVA,这样才能配置Tomcat环境.很多用户并不知道要如何进行配置,下面就给大家介绍win10系统怎样Tomcat环境变量的. ...