REPEATABLE READ

This is the default isolation level for InnoDB. For consistent reads, there is an important 

difference from the READ COMMITTED isolation level: All consistent reads within the same 

transaction read the snapshot established by the first read. This convention means that if you 

issue several plain (nonlocking) SELECT statements within the same transaction, these SELECT 

statements are consistent also with respect to each other. See Section 14.3.2.3, “Consistent 

Nonlocking Reads”.

这是默认的隔离级别是InnoDB,对于一致性读,这里有一个重要的区别和READ COMMITTED isolation level

所有的一致性读在相同的事务里读取第一次读创建的快照。

这意味着如果你执行多个普通的(非锁定读) 

SELECT 语句在相同的实例,SELECT 语句是一致性读。

For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE), UPDATE, and DELETE 

statements, locking depends on whether the statement uses a unique index with a unique search 

condition, or a range-type search condition. For a unique index with a unique search condition, 

InnoDB locks only the index record found, not the gap before it. For other search conditions, 

InnoDB locks the index range scanned, using gap locks or next-key locks to block insertions by 

other sessions into the gaps covered by the range.

对于lockding reads(SELECT  FOR UPDATE or LOCK IN SHARE MODE),

UPDATE, and DELETE语句, lockding 依赖是否语句使用一个唯一索引进行一个唯一搜索条件,

或者一个range-type 搜索条件,  对于一个唯一索引 使用一个唯一搜索条件,

InnoDB 只锁 找到的index record,不是 gap before it.

对于其他的搜索条件,InnoDB locks 定索引范围扫描,使用gap locks 或者next-key locks 

来堵塞 其他会话插入到这个区间

READ COMMITTED

一个Oracle 类似的隔离级别一致的非锁定读,

每个一致读, 甚至在相同的会话,设置和读取它自己最新鲜的快照

对于锁定读(SELECT with FOR UPDATE or LOCK IN SHARE MODE),

UPDATE statements, and DELETE statements

InnoDB 只锁定 index records,不是 gaps before them,

因此允许新记录自由插入到紧挨着锁定的记录

Mysql rr和rc隔离的更多相关文章

  1. mysql rr和rc区别

    <pre name="code" class="html">1. 数据库事务ACID特性 数据库事务的4个特性: 原子性(Atomic): 事务中的 ...

  2. RR 和RC隔离问题

    Sesssion 1: mysql> select @@tx_isolation; +-----------------+ | @@tx_isolation | +--------------- ...

  3. 一文彻底读懂MySQL事务的四大隔离级别

    前言 之前分析一个死锁问题,发现自己对数据库隔离级别理解还不够清楚,所以趁着这几天假期,整理一下MySQL事务的四大隔离级别相关知识,希望对大家有帮助~ 事务 什么是事务? 事务,由一个有限的数据库操 ...

  4. 【MySQL 读书笔记】RR(REPEATABLE-READ)事务隔离详解

    这篇我觉得有点难度,我会更慢的更详细的分析一些 case . MySQL 的默认事务隔离级别和其他几个主流数据库隔离级别不同,他的事务隔离级别是 RR(REPEATABLE-READ) 其他的主流数据 ...

  5. MySQL--事务隔离级别RR和RC的异同

    在MySQL中,事务隔离级别RC(read commit)和RR(repeatable read)两种事务隔离级别基于多版本并发控制MVCC(multi-version concurrency con ...

  6. [原创]MySQL RR隔离级别下begin或start transaction开启事务后的可重复读?

    Server version:         5.6.21-log MySQL Community Server (GPL) 前提提要: 我们知道MySQL的RR(repeatable read)隔 ...

  7. MySQL RR隔离 读一致性

    MySQL RR 模式下 事务隔离问题: Session 1: mysql> select * from test; +------+------+ | id | name | +------+ ...

  8. RR 和RC 幻读问题

    <pre name="code" class="html">显然 RR 支持 gap lock(next-key lock),而RC则没有gap l ...

  9. mysql RR下不存在则插入

    主要看并发事务中不存在则插入(只有key索引)的阻塞情况. 表定义: mysql> desc user; +-------------+------------------+------+--- ...

随机推荐

  1. VS2008查看dll导出函数

    打开Visual Studio 2008 命令提示,使用命令 [plain] view plaincopyprint? dumpbin /exports simple.dll 即可查看

  2. Ext的异步请求(二级级联动态加载下拉列表)

    页面: <tr> <td class="label" width="300" >作业计划项模板</td> <td> ...

  3. cocos2d-x3.2中加入Android手机震动

    本人宣布从此博文发出后,我的cocos2dx的引擎从cocos2dx3.1.1跳到cocos2dx3.2,哈哈,事实上变化不大的,不碍事~~~ 以下来说说在cocos中加入Android手机震动的功能 ...

  4. PHP - 图像处理

    第14章 处理图像 学习要点: 1.创建图像 2.简单小案例 在PHP5中,动态图象的处理要比以前容易得多.PHP5在php.ini文件中包含了GD扩展包,只需去掉GD扩展包的相应注释就可以正常使用了 ...

  5. .net版Git Server --- bonobo

    官网地址: https://bonobogitserver.com/ Demo: http://demo.bonobogitserver.com/Home/LogOn  登入admin:admin C ...

  6. WCF技术剖析之三:如何进行基于非HTTP的IIS服务寄宿

    原文:[原创]WCF技术剖析之三:如何进行基于非HTTP的IIS服务寄宿 在上面一篇文章中,我们对不同版本的IIS,以及ASP.NET得的实现机制进行了详细而深入的分析.在介绍IIS7.0的时候,我们 ...

  7. boost::property_tree读取解析ini文件--推荐

    boost::property_tree读取解析ini文件 #include "stdafx.h" #include <iostream> #include <b ...

  8. 项目.c文件和.h文件关系

                "如有不正确之处,请指出,谢谢"       --Mood 对于一个项目,我们应该要很好的处理众多的.c和.h文件. 1.通过头文件调用库功能:#inclu ...

  9. Eclipse完美汉化教程

    首先我们打开http://www.eclipse.org/babel/downloads.php下载语言包. 方法一:可以复制图片里的地址通过Eclipse下载,Help→Install New So ...

  10. SRM 583 Div II Level One:SwappingDigits

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12609 #include <iostream> # ...