mysql snapshot read快照讀及current read當前讀與鎖lock之一
前言
mysql讀操作分為2種型別:snapshot read及current read,前者基於mysql mvcc實現,讀取資料塊是undo block,後者是基於當前資料塊。這2種不同的讀取型別與鎖的關係是什麼,本文作一點兒簡要的記錄。
聯絡方式
-
微信公眾號
-
微信
目錄
snapshot read是否加鎖
snapshot read由於操作非當前資料塊,不會加鎖
current read加鎖2種型別
-
x --排它鎖
-
s --共享鎖
current read幾種操作場景
查詢current read不同操作場景持鎖語句
(注:關注列lock_mode)
mysql> select * from information_schema.innodb_locks; +-------------------------+-----------------+-----------+-----------+------------------+-----------------+------------+-----------+----------+----------------+ | lock_id | lock_trx_id | lock_mode | lock_type | lock_table | lock_index | lock_space | lock_page | lock_rec | lock_data | +-------------------------+-----------------+-----------+-----------+------------------+-----------------+------------+-----------+----------+----------------+ | 11909:473:3:2 | 11909 | X | RECORD | `zxydb`.`t_read` | GEN_CLUST_INDEX | 473 | 3 | 2 | 0x00000836F561 | | 421207096970864:473:3:2 | 421207096970864 | S | RECORD | `zxydb`.`t_read` | GEN_CLUST_INDEX | 473 | 3 | 2 | 0x00000836F561 | +-------------------------+-----------------+-----------+-----------+------------------+-----------------+------------+-----------+----------+----------------+ 2 rows in set, 1 warning (0.00 sec)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-2666289/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL 8.0 Reference Manual(讀書筆記66節--locking read 與lock)MySql筆記
- 8.2 快照讀,當前讀
- MySQL5.7 Waiting for global read lockMySqlAI
- Lock鎖之重入鎖與讀寫鎖
- mysql innodb lock鎖之record lock之一MySql
- mysql關於FLUSH TABLES和FLUSH TABLES WITH READ LOCK的理解MySql
- 05 Shell read讀取控制檯輸入
- MySQL的repeatable readMySql
- @1-MYSQL當前使用者user()與current_user()MySql
- mysql中read commited與repeatable read兩種隔離級別的測試MySqlMIT
- Mysql的read_only 只讀屬性說明 (運維筆記)MySql運維筆記
- Reading Face, Read Health論文閱讀筆記筆記
- MySQL事務(4種事務隔離級別、髒寫、髒讀、不可重複讀、幻讀、當前讀、快照讀、MVCC、事務指標監控)MySqlMVC指標
- Lock介面、重入鎖ReentrantLock、讀寫鎖ReentrantReadWriteLockReentrantLock
- 對Mysql中的read_only 只讀屬性做簡要說明MySql
- Maven 快照(SNAPSHOT)Maven
- Oracle一致性讀(Consistent Read)的原理Oracle
- MySQL MyISAM引擎的讀鎖與寫鎖MySql
- MySQL學習之MVCC原理和當前讀MySqlMVC
- shell指令碼while迴圈、read讀取控制檯輸入與函式指令碼While函式
- Oracle 11g 新特性:只讀表(Read-only)Oracle
- 閱讀器關閉時嘗試呼叫 Read 無效。
- 【JavaSE】Lock鎖和synchronized鎖的比較,lock鎖的特性,讀寫鎖的實現。Javasynchronized
- direct path read/read temp等待事件事件
- python中讀取檔案的read、readline、readlines方法區別Python
- Linux核心同步機制之(五):Read Write spin lock【轉】Linux
- Read a story
- READ ME
- 等待事件db file sequential read、db file scattered read和direct read的區別事件
- [20200309]expdp 與read only.txt
- db block gets 與 consistent read getsBloC
- SRAM的Write Assist與Read Assist
- Mysql可重複讀(1) —— 快照何時建立MySql
- TIC Read Status
- Read-onlydynamicdata
- [Bash] read command
- MySQL:Innodb Handler_read_*引數解釋MySql
- Django Mysql SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTEDDjangoMySqlSessionMIT