鎖表特點(diǎn)--myisam和innodb的不同之處

對(duì)于myisam表, lock table table_name read local, 并且下面參數(shù)為2, 3 ,那么允許另一個(gè)回話執(zhí)行insert 語句
root@sakila 08:17:02>show variables like '%concurrent%';
+-------------------+--------+
| Variable_name     | Value  |
+-------------------+--------+
| concurrent_insert | ALWAYS |
+-------------------+--------+
1 row in set (0.01 sec)


root@sakila 08:19:29>lock table myfilm_text read local;
Query OK, 0 rows affected (0.01 sec)

同一個(gè)會(huì)話是不能執(zhí)行insert的,因?yàn)槟闵系氖侵蛔x鎖
root@sakila 08:19:37>insert into myfilm_text(film_id, title) values(1002, 'Test');
ERROR 1099 (HY000): Table 'myfilm_text' was locked with a READ lock and can't be updated

*********************************************
另一個(gè)會(huì)話:
可以并發(fā)插入,依次可以實(shí)現(xiàn)一定程度的并發(fā)。
root@sakila 08:18:32>insert into myfilm_text(film_id, title) values(1002, 'Test');
Query OK, 1 row affected (0.02 sec)


網(wǎng)站名稱:鎖表特點(diǎn)--myisam和innodb的不同之處
網(wǎng)址分享:http://muchs.cn/article8/ghepip.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、面包屑導(dǎo)航、全網(wǎng)營(yíng)銷推廣、App設(shè)計(jì)、微信小程序、關(guān)鍵詞優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

綿陽服務(wù)器托管