返回顶部
首页 > 资讯 > 数据库 >mysql锁官方文档与理解之InnoDB锁
  • 525
分享到

mysql锁官方文档与理解之InnoDB锁

摘要

    This section describes lock types used by InnoDB. 翻译:本节描述了InnoDB使用的锁类型。 Shared and Exclusive Locks(共享锁和排他锁) Int


	mysql锁官方文档与理解之InnoDB锁
[数据库教程]

 

 

This section describes lock types used by InnoDB.

翻译:本节描述了InnoDB使用的类型。

  • Shared and Exclusive Locks(共享锁和排他锁)

  • Intention Locks(意向锁)

  • Record Locks(记录锁)

  • Gap Locks(间隙锁)

  • Next-Key Locks(next-key锁)

  • Insert Intention Locks(插入意向锁)

  • AUTO-INC Locks(AUTO-INC锁)

  • Predicate Locks for Spatial Indexes(空间索引的谓词锁)

 

Shared and Exclusive Locks(共享锁和排他锁)

InnoDB implements standard row-level locking where there are two types of locks, shared (S) locks and exclusive (X) locks.

翻译:InnoDB实现了标准的行级锁,其中有两种锁,共享锁和独占锁。

  • A shared (S) lock permits the transaction that holds the lock to read a row.(共享(S)锁允许持有锁的事务读取一行)

  • An exclusive (X) lock permits the transaction that holds the lock to update or delete a row.(独占(X)锁允许持有锁的事务更新或删除一行。)

If transaction T1 holds a shared (S) lock on row r, then requests from some distinct transaction T2 for a lock on row r are handled as follows:

翻译:如果事务T1在r行上持有一个共享的(S)锁,那么从某个不同的事务T2请求在r行上持有一个锁的处理如下:

  • A request by T2 for an S lock can be granted immediately. As a result, both T1 and T2 hold an S lock on r.(T2对S锁的请求可以立即被授予。因此,T1和T2都对r持有S锁。)

  • A request by T2 for an X lock cannot be granted immediately.(T2对X锁的请求不能立即被授予。)

If a transaction T1 holds an exclusive (X) lock on row r, a request from some distinct transaction T2 for a lock of either type on r cannot be granted immediately. Instead, transaction T2 has to wait for transaction T1 to release its lock on row r.

翻译:如果事务T1在r行上持有排他(X)锁,则不能立即授予来自不同事务T2对r上任何一种类型的锁的请求。相反,事务T2必须等待事务T1释放它在行r上的锁。

 

Intention Locks(意向锁)

InnoDB supports multiple granularity locking which permits coexistence of row locks and table locks. For example, a statement such as LOCK TABLES ... WRITE takes an exclusive lock (an X lock) on the specified table. To make locking at multiple granularity levels practical, InnoDB uses intention locks. Intention locks are table-level locks that indicate which type of lock (shared or exclusive) a transaction requires later for a row in a table. There are two types of intention locks:

翻译:InnoDB支持多粒度锁,允许行锁和表锁共存。例如,像 LOCK TABLES ... WRITE这样的语句接受指定表上的独占锁(X锁)。为了实现多粒度级别的锁,InnoDB使用意向锁。意图锁是表级锁,指示事务稍后需要哪种类型的锁(共享的或排他的)来锁定表中的某一行。意图锁有两种类型:

  • An intention shared lock (IS) indicates that a transaction intends to set a shared lock on individual rows in a table.(意图共享锁(IS)表示事务打算对表中的各个行设置共享锁。)

  • An intention exclusive lock (IX) indicates that a transaction intends to set an exclusive lock on individual rows in a table.(意图排他锁(IX)表示事务打算对表中的各个行设置排他锁。)

For example, SELECT ... LOCK IN SHARE MODE sets an IS lock, and SELECT ... FOR UPDATE sets an IX lock.

翻译:例如,SELECT ... LOCK IN SHARE MODE设置IS锁,SELECT ... FOR UPDATE设置IX锁。

The intention locking protocol is as follows:

翻译:意向锁协议如下:

  • Before a transaction can acquire a shared lock on a row in a table, it must first acquire an IS lock or stronger on the table.(事务在获得表中某行上的共享锁之前,必须先获得表上的IS锁或更强的锁。)

  • Before a transaction can acquire an exclusive lock on a row in a table, it must first acquire an IX lock on the table.(在事务可以获得表中某一行上的排他锁之前,它必须首先获得表上的IX锁。)

Table-level lock type compatibility is summarized in the following matrix.

翻译:表级锁类型兼容性在下面的矩阵中进行了总结

 XIXSIS
X Conflict Conflict Conflict Conflict
IX Conflict Compatible Conflict Compatible
S Conflict Conflict Compatible Compatible
IS Conflict Compatible Compatible Compatible

A lock is granted to a requesting transaction if it is compatible with existing locks, but not if it conflicts with existing locks. A transaction waits until the conflicting existing lock is released. If a lock request conflicts with an existing lock and cannot be granted because it would cause deadlock, an error occurs.

翻译:如果与现有锁兼容,则将锁授予请求事务,但如果与现有锁冲突则不授予。事务将一直等待,直到有冲突的现有锁被释放。如果一个锁请求与一个现有的锁冲突,并且不能被授予,因为这会导致死锁,那么就会发生错误。

Intention locks do not block anything except full table requests (for example, LOCK TABLES ... WRITE). The main purpose of intention locks is to show that someone is locking a row, or Going to lock a row in the table.

翻译:意向锁不阻塞任何东西,除了全表请求(例如,LOCK TABLES ... WRITE)。意图锁的主要目的是显示某人正在锁定或准备锁定表中的一行。

Transaction data for an intention lock appears similar to the following in SHOW ENGINE INNODB STATUS and InnoDB monitor output:

翻译:意图锁的事务数据在SHOW ENGINE INNODB STATUS 和 InnoDB monitor输出中类似如下:

TABLE LOCK table `test`.`t` trx id 10080 lock mode IX

 

Record Locks(记录锁)

A record lock is a lock on an index record. For example, SELECT c1 FROM t WHERE c1 = 10 FOR UPDATE; prevents any other transaction from inserting, updating, or deleting rows where the value of t.c1 is 10.

Record locks always lock index records, even if a table is defined with no indexes. For such cases, InnoDB creates a hidden clustered index and uses this index for record locking. See Section 14.6.2.1, “Clustered and Secondary Indexes”.

翻译:记录锁是在一个索引记录上加的锁。例如,SELECT c1 FROM t WHERE c1 = 10 FOR UPDATE;防止任何其他事务插入、更新或删除t.c1值为10的行。记录锁总是锁定索引记录,即使表没有定义索引。

对于这种情况,InnoDB创建一个隐藏的聚集索引并使用这个索引来锁定记录。参见14.6.2.1节“聚集和二级索引”。

Transaction data for a record lock appears similar to the following in SHOW ENGINE INNODB STATUS and InnoDB monitor output:

翻译:记录锁的事务数据在SHOW ENGINE INNODB STATUS和InnoDB monitor输出中类似如下

 
RECORD LOCKS space id 58 page no 3 n bits 72 index `PRIMARY` of table `test`.`t`
trx id 10078 lock_mode X locks rec but not gap
Record lock, heap no 2 PHYSICAL RECORD: n_fields 3; compact fORMat; info bits 0
 0: len 4; hex 8000000a; asc     ;;
 1: len 6; hex 00000000274f; asc     ‘O;;
 2: len 7; hex b60000019d0110; asc        ;;

 

Gap Locks(间隙锁)

A gap lock is a lock on a gap between index records, or a lock on the gap before the first or after the last index record. For example, SELECT c1 FROM t WHERE c1 BETWEEN 10 and 20 FOR UPDATE; prevents other transactions from inserting a value of 15 into column t.c1, whether or not there was already any such value in the column, because the gaps between all existing values in the range are locked.

翻译:间隙锁是在索引记录之间间隙的锁,或者对第一个索引记录之前或最后一个索引记录之后的间隙的锁。例如,SELECT c1 FROM t WHERE c1 BETWEEN 10 and 20 FOR UPDATE;防止其他事务在列t.c1中插入15的值,无论列中是否已经有这样的值,因为范围内所有现有值之间的间隙都被锁定。

A gap might span a single index value, multiple index values, or even be empty.

翻译:一个间隙可能跨越一个索引值、多个索引值,甚至是空的。

Gap locks are part of the tradeoff between performance and concurrency, and are used in some transaction isolation levels and not others.

翻译:间隙锁是性能和并发性折衷的一部分,在某些事务隔离级别中使用,而在其他级别中不使用。

Gap locking is not needed for statements that lock rows using a unique index to search for a unique row. (This does not include the case that the search condition includes only some columns of a multiple-column unique index; in that case, gap locking does occur.) For example, if the id column has a unique index, the following statement uses only an index-record lock for the row having id value 100 and it does not matter whether other sessions insert rows in the preceding gap:

翻译:对于使用惟一索引来搜索惟一行来锁定行的语句,则不需要间隙锁定。(这不包括搜索条件只包括多列唯一索引的一些列;在这种情况下,间隙锁定确实会发生。) 例如,如果id列有一个唯一的索引,下面的语句只对id值为100的行使用索引-记录锁,其他会话是否在前面的间隙插入行并不重要:

SELECT * FROM child WHERE id = 100;

If id is not indexed or has a nonunique index, the statement does lock the preceding gap.

翻译:如果id没有索引或具有非惟一索引,该语句会锁定前面的间隙。

It is also worth noting here that conflicting locks can be held on a gap by different transactions. For example, transaction A can hold a shared gap lock (gap S-lock) on a gap while transaction B holds an exclusive gap lock (gap X-lock) on the same gap. The reason conflicting gap locks are allowed is that if a record is purged from an index, the gap locks held on the record by different transactions must be merged.

翻译:这里还值得注意的是,不同的事务可以在间隙上持有冲突锁。例如,事务A可以在一个间隙上持有一个共享的间隙锁(间隙S-lock),同时事务B可以在同一个间隙上持有一个排他的间隙锁(间隙X-lock)。允许存在冲突间隙锁的原因是,如果从索引中清除一条记录,则必须合并记录上由不同事务持有的间隙锁。

Gap locks in InnoDB are purely inhibitive”, which means that their only purpose is to prevent other transactions from inserting to the gap. Gap locks can co-exist. A gap lock taken by one transaction does not prevent another transaction from taking a gap lock on the same gap. There is no difference between shared and exclusive gap locks. They do not conflict with each other, and they perform the same function.

翻译:InnoDB中的间隙锁是“纯粹的禁忌”,这意味着它们的唯一目的是防止其他事务插入到间隙中。间隙锁可以共存。一个事务所获取的间隙锁不会阻止另一个事务在同一间隙上获取间隙锁。共享间隙锁和独占间隙锁之间没有区别。它们彼此不冲突,并且执行相同的功能。

Gap locking can be disabled explicitly. This occurs if you change the transaction isolation level to READ COMMITTED or enable the innodb_locks_unsafe_for_binlog system variable (which is now deprecated). Under these circumstances, gap locking is disabled for searches and index scans and is used only for foreign-key constraint checking and duplicate-key checking.

翻译:可以显式禁用间隙锁定。如果您更改事务隔离级别为READ COMMITTED或启用innodb_locks_unsafe_for_binlog系统变量(该变量现在不赞成使用),就会发生这种情况。在这些情况下,间隙锁定对于搜索和索引扫描是禁用的,只用于外键约束检查和重复键检查。

There are also other effects of using the READ COMMITTED isolation level or enabling innodb_locks_unsafe_for_binlog. Record locks for nonmatching rows are released after Mysql has evaluated the WHERE condition. For UPDATE statements, InnoDB does a semi-consistent” read, such that it returns the latest committed version to mysql so that Mysql can determine whether the row matches the WHERE condition of the UPDATE.

翻译:使用READ COMMITTED隔离级别或启用innodb_locks_unsafe_for_binlog还有其他影响。在MySQL评估了WHERE条件后,将释放非匹配行的记录锁。对于UPDATE语句,InnoDB执行“半一致”读取,这样它就会返回最新提交的版本给MySQL,这样MySQL就可以确定行是否与UPDATE的WHERE条件匹配。

 

Next-Key Locks(next-key锁)

A next-key lock is a combination of a record lock on the index record and a gap lock on the gap before the index record.

翻译:next-key锁是索引记录上的记录锁和索引记录前间隙上的间隙锁的组合。

InnoDB performs row-level locking in such a way that when it searches or scans a table index, it sets shared or exclusive locks on the index records it encounters. Thus, the row-level locks are actually index-record locks. A next-key lock on an index record also affects the gap” before that index record. That is, a next-key lock is an index-record lock plus a gap lock on the gap preceding the index record. If one session has a shared or exclusive lock on record R in an index, another session cannot insert a new index record in the gap immediately before R in the index order.

翻译:InnoDB执行行级锁的方式是,当它搜索或扫描一个表索引时,它会对遇到的索引记录设置共享锁或排他锁。因此,行级锁实际上是索引记录锁。索引记录上的next-key锁还会影响该索引记录之前的“间隙”。也就是说,next-key锁是索引记录锁加上索引记录之前的间隙锁。如果一个会话对索引中的记录R有共享或排他锁,则另一个会话不能在索引顺序中紧靠R之前的间隙插入新的索引记录。

Suppose that an index contains the values 10, 11, 13, and 20. The possible next-key locks for this index cover the following intervals, where a round bracket denotes exclusion of the interval endpoint and a square bracket denotes inclusion of the endpoint:

翻译:假设索引包含值10、11、13和20。这个索引可能的next-key锁包括以下的时间间隔,其中圆括号表示间隔端点的排除,方括号表示端点的包含:

(negative infinity, 10]
(10, 11]
(11, 13]
(13, 20]
(20, positive infinity)

For the last interval, the next-key lock locks the gap above the largest value in the index and the supremum” pseudo-record having a value higher than any value actually in the index. The supremum is not a real index record, so, in effect, this next-key lock locks only the gap following the largest index value.

翻译:对于最后一个间隔,next-key锁锁定索引中最大值和“上极”伪记录(其值比实际索引中的任何值都高)之间的间隙。上限值并不是一个真正的索引记录,因此,这个next-key锁实际上只锁定了最大索引值之后的间隙。

By default, InnoDB operates in REPEATABLE READ transaction isolation level. In this case, InnoDB uses next-key locks for searches and index scans, which prevents phantom rows (see Section 14.7.4, “Phantom Rows”).

翻译:默认情况下,InnoDB操作在可重复读事务隔离级别。在这种情况下,InnoDB使用next-key锁进行搜索和索引扫描,这可以防止幻像行(见14.7.4节“幻像行”)。

Transaction data for a next-key lock appears similar to the following in SHOW ENGINE INNODB STATUS and InnoDB monitor output:

翻译:下一键锁定的事务数据在SHOW ENGINE INNODB STATUS和InnoDB monitor输出中类似如下:

RECORD LOCKS space id 58 page no 3 n bits 72 index `PRIMARY` of table `test`.`t`
trx id 10080 lock_mode X
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
 0: len 8; hex 73757072656d756d; asc supremum;;

Record lock, heap no 2 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 4; hex 8000000a; asc     ;;
 1: len 6; hex 00000000274f; asc     ‘O;;
 2: len 7; hex b60000019d0110; asc        ;;

 

Insert Intention Locks(插入意向锁)

An insert intention lock is a type of gap lock set by INSERT operations prior to row insertion. This lock signals the intent to insert in such a way that multiple transactions inserting into the same index gap need not wait for each other if they are not inserting at the same position within the gap. Suppose that there are index records with values of 4 and 7. Separate transactions that attempt to insert values of 5 and 6, respectively, each lock the gap between 4 and 7 with insert intention locks prior to obtaining the exclusive lock on the inserted row, but do not block each other because the rows are nonconflicting.

翻译:插入意图锁是一种间隙锁,由行插入之前的插入操作设置。如果多个插入到同一个索引间隙的事务没有在间隙内的相同位置插入,则该锁将以这样的方式标示插入的意图:多个插入到同一个索引间隙的事务不需要相互等待。假设有值为4和7的索引记录。分别尝试插入值为5和6的独立事务,在获得插入行的排他锁之前,都使用插入意图锁锁住4和7之间的间隙,但不会相互阻塞,因为这两行不冲突。

The following example demonstrates a transaction taking an insert intention lock prior to obtaining an exclusive lock on the inserted record. The example involves two clients, A and B.

翻译:下面的示例演示了一个事务,该事务在获得插入记录上的排他锁之前使用插入意图锁。该示例涉及两个客户机,A和B。

Client A creates a table containing two index records (90 and 102) and then starts a transaction that places an exclusive lock on index records with an ID greater than 100. The exclusive lock includes a gap lock before record 102:

翻译:客户机A创建一个包含两个索引记录(90和102)的表,然后启动一个事务,该事务对ID大于100的索引记录施加排他锁。排他锁包括记录102前的间隙锁:

mysql> CREATE TABLE child (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
mysql> INSERT INTO child (id) values (90),(102);

mysql> START TRANSACTION;
mysql> SELECT * FROM child WHERE id > 100 FOR UPDATE;
+-----+
| id  |
+-----+
| 102 |
+-----+

Client B begins a transaction to insert a record into the gap. The transaction takes an insert intention lock while it waits to obtain an exclusive lock.

翻译:客户端B开始一个事务,向间隙插入一条记录。事务在等待获得排他锁时,采用插入意图锁。

mysql> START TRANSACTION;
mysql> INSERT INTO child (id) VALUES (101);

Transaction data for an insert intention lock appears similar to the following in SHOW ENGINE INNODB STATUS and InnoDB monitor output:

翻译:插入意图锁的事务数据在SHOW ENGINE INNODB STATUS和InnoDB monitor 输出中类似如下:

 
RECORD LOCKS space id 31 page no 3 n bits 72 index `PRIMARY` of table `test`.`child`
trx id 8731 lock_mode X locks gap before rec insert intention waiting
Record lock, heap no 3 PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 4; hex 80000066; asc    f;;
 1: len 6; hex 000000002215; asc     " ;;
 2: len 7; hex 9000000172011c; asc     r  ;;...

 

AUTO-INC Locks(AUTO-INC锁)

An AUTO-INC lock is a special table-level lock taken by transactions inserting into tables with AUTO_INCREMENT columns. In the simplest case, if one transaction is inserting values into the table, any other transactions must wait to do their own inserts into that table, so that rows inserted by the first transaction receive consecutive primary key values.

翻译:AUTO-INC锁是一种特殊的表级锁,通过事务插入到具有AUTO_INCREMENT列的表中来实现。在最简单的情况下,如果一个事务向表中插入值,那么任何其他事务都必须等待对该表进行自己的插入,以便由第一个事务插入的行接收到连续的主键值。

The innodb_autoinc_lock_mode configuration option controls the algorithm used for auto-increment locking. It allows you to choose how to trade off between predictable sequences of auto-increment values and maximum concurrency for insert operations.

翻译:innodb_autoinc_lock_mode配置选项控制用于自动增量锁定的算法。它允许您选择如何在自动递增值的可预测序列和插入操作的最大并发性之间进行权衡。

For more information, see Section 14.6.1.6, “AUTO_INCREMENT Handling in InnoDB”.

翻译:更多信息,请参见14.6.1.6节“InnoDB中的自动递增处理”。

 

Predicate Locks for Spatial Indexes(空间索引的谓词锁)

InnoDB supports SPATIAL indexing of columns containing spatial columns (see Section 11.4.8, “Optimizing Spatial Analysis”).

翻译:InnoDB支持对包含空间列的列进行空间索引(参见第11.4.8节“优化空间分析”)。

To handle locking for operations involving SPATIAL indexes, next-key locking does not work well to support REPEATABLE READ or SERIALIZABLE transaction isolation levels. There is no absolute ordering concept in multidimensional data, so it is not clear which is the next” key.

翻译:为了处理涉及空间索引的操作的锁,next-key锁在支持可重复读取或可序列化事务隔离级别时不能很好地工作。在多维数据中没有绝对的排序概念,因此不清楚哪一个是“下一个”键。

To enable support of isolation levels for tables with SPATIAL indexes, InnoDB uses predicate locks. A SPATIAL index contains minimum bounding rectangle (MBR) values, so InnoDB enforces consistent read on the index by setting a predicate lock on the MBR value used for a query. Other transactions cannot insert or modify a row that would match the query condition.

翻译:为了支持具有空间索引的表的隔离级别,InnoDB使用谓词锁。空间索引包含最小边界矩形(MBR)值,因此InnoDB通过对用于查询的MBR值设置谓词锁来强制对索引进行一致读取。其他事务不能插入或修改与查询条件匹配的行。

 

参考mysql官方文档链接:

https://dev.mysql.com/doc/refman/5.7/en/innodb-locking.html

 

mysql锁官方文档与理解之InnoDB锁

原文地址:Https://www.cnblogs.com/wanghengbin/p/13337293.html

您可能感兴趣的文档:

--结束END--

本文标题: mysql锁官方文档与理解之InnoDB锁

本文链接: https://lsjlt.com/news/7298.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
  • mysql锁官方文档与理解之InnoDB锁
        This section describes lock types used by InnoDB. 翻译:本节描述了InnoDB使用的锁类型。 Shared and Exclusive Locks(共享锁和排他锁) Int...
    99+
    2021-05-07
    mysql锁官方文档与理解之InnoDB锁 数据库入门 数据库基础教程 数据库 mysql
  • MySQL InnoDB锁(翻译自官方手册)
    本文基于mysql 8.0,官方手册: https://dev.mysql.com/doc/refman/8.0/en/innodb-locking.html,同时参考了mysql锁机制详解 主要内容如下: 共享锁和排他锁(Sh...
    99+
    2020-11-19
    MySQL InnoDB锁(翻译自官方手册)
  • 怎么理解mysql innodb的行锁方式
    本篇内容主要讲解“怎么理解mysql innodb的行锁方式”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“怎么理解mysql innodb的行锁方式”吧! ...
    99+
    2024-04-02
  • InnoDB事务锁之行锁-隐式锁转换显示锁举例理解原理
    ...
    99+
    2024-04-02
  • MySQL InnoDB锁类型及锁原理实例解析
    目录锁共享锁排他锁意向锁记录锁间隙锁临键锁死锁死锁产生条件行锁发生死锁表锁发生死锁锁的释放事务阻塞死锁的避免锁的日志行锁的原理不带任何索引的表带主键索引的表带唯一索引的表结论1.表必定有索引2.唯一索引数据行加锁,主键索...
    99+
    2022-11-27
    MySQL InnoDB锁类型锁原理 MySQL InnoDB 锁
  • 如何理解MySQL 5.5 InnoDB表锁
    本篇文章为大家展示了如何理解MySQL 5.5 InnoDB表锁,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。 对于没有索引的表,MyS...
    99+
    2024-04-02
  • 怎么理解mysql innodb的行锁
    这篇文章主要讲解了“怎么理解mysql innodb的行锁”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“怎么理解mysql innodb的行锁”吧! ...
    99+
    2024-04-02
  • 如何理解MYSQL 解锁与锁表
    如何理解MYSQL 解锁与锁表,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。 解锁第一种show processl...
    99+
    2024-04-02
  • MySQL的innoDB锁机制以及死锁的处理方法
    本篇内容主要讲解“MySQL的innoDB锁机制以及死锁的处理方法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“MySQL的innoDB锁机制以及死锁的处理方法...
    99+
    2024-04-02
  • MySQL InnoDB事务与锁的详细讲解
    这篇文章主要介绍“MySQL InnoDB事务与锁的详细讲解”,在日常操作中,相信很多人在MySQL InnoDB事务与锁的详细讲解问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解...
    99+
    2024-04-02
  • Mysql技术内幕之InnoDB锁的深入讲解
    前言 自7月份换工作以来,期间一直在学习MySQL的相关知识,听了一些视频课,但是一直好奇那些讲师的知识是从哪里学习的。于是想着从书籍中找答案。毕竟一直 看视频也不是办法,不能形成自己的知识。于是想着看书汲取知识,看...
    99+
    2022-05-10
    mysql innodb锁 mysql查innodb
  • 如何理解mysql innodb lock锁中的record lock
    本篇文章给大家分享的是有关如何理解mysql innodb lock锁中的record lock,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。...
    99+
    2024-04-02
  • ZooKeeper官方文档之Java案例解读
    目录需求理解举例类比Executor和DataMonitor内部类和接口Executor:DataMonitor:继承关系Executor:DataMonitor:引用关系Execu...
    99+
    2024-04-02
  • 一文带你了解MySQL之锁
    目录 一、解决并发事务带来问题的两种基本方式1.1 一致性读(Consistent Reads)1.2 锁定读(Locking Reads)1.2.1 共享锁和独占锁1.2.2 锁定读的语句 1.3 写操作 二、多粒度锁三...
    99+
    2023-08-16
    mysql 数据库 大数据 数据库架构 数据库开发
  • mysql 锁机制与原理详解
    前言 不管是数据库,还是很多后端编程语言,都存在锁的机制,锁的存在有效解决了并发情况下对共同资源的抢占,保证了数据的稳定性和一致性,在mysql中,锁是如何工作的呢?其底层的工作原理是怎样的呢?本篇将详细介绍下mysql锁的机制。 mys...
    99+
    2023-09-16
    mysql 锁原理 mysql 锁机制 mysql 锁使用
  • Vue官方文档梳理之全局API的示例分析
    这篇文章将为大家详细讲解有关Vue官方文档梳理之全局API的示例分析,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。Vue.extend配置项data必须为function...
    99+
    2024-04-02
  • MySql 知识点之事务、索引、锁原理与用法解析
    本文实例讲述了MySql 知识点之事务、索引、锁原理与用法。分享给大家供大家参考,具体如下: 事务 事务概念 事务就是一组原子性的SQL查询,或者说一个独立的工作单元。如果数据库引擎执行一组操作语句...
    99+
    2024-04-02
  • MySQL 原理与优化之原数据锁的应用
    mysql 中原数据锁是系统自动控制添加的,对于用户来说无需显示调用,当我们使用一张表的时候就会加上原数据锁。 原数据锁的作用是为了保护表原数据的一致性,如果在表上有活动事务的时候,不可以对元数据进行写入操作。也就是为...
    99+
    2022-08-14
    MySQL 原理优化 MySQL原数据锁应用
  • pytest官方文档解读之安装和使用插件的方法
    目录一、pip 安装二、查找可用插件三、在测试模块或者conftest文件中加载指定插件四、查看被激活的插件五、注销插件本节讨论安装和使用第三方插件。关于编写自己的插件,我们下一章继...
    99+
    2024-04-02
  • 深入理解 MySQL ——锁、事务与并发控制
    本文首发于vivo互联网技术微信公众号作者:张硕本文对 MySQL 数据库中有关锁、事务及并发控制的知识及其原理做了系统化的介绍和总结,希望帮助读者能更加深刻地理解 MySQL 中的锁和事务,从而在业务系...
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作