Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5177535

Browse files
mysql锁机制
1 parent 45681bd commit 5177535

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎My ISAM表锁/独占写锁‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
独占写锁它实际上是以独占的方式去访问我们这个锁,如果我们给这个表加上一个写锁,那么其他的客户端它是没办法对它进行一个读写访问的。
2+
3+
4+
5+
6+
并发插入(Concurrent Inserts)
7+
上文提到过MyISAM表的读和写是串行的,但这是就总体而言的。在一定条件下,MyISAM表也支持查询和插入操作的并发进行。
8+
MyISAM存储引擎有一个系统变量concurrent_insert,专门用以控制其并发插入的行为,其值分别可以为0、1或2。
9+
1.当concurrent_insert设置为0时,不允许并发插入。
10+
2.当concurrent_insert设置为1时,如果MyISAM表中没有空洞(即表的中间没有被删除的行),
11+
MyISAM允许在一个进程读表的同时,另一个进程从表尾插入记录。这也是MySQL的默认设置。
12+
3.当concurrent_insert设置为2时,无论MyISAM表中有没有空洞,都允许在表尾并发插入记录。

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /