Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql snapshot read snapshot read and current read one of the current read and lock lock

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Preface

There are two types of mysql read operations: snapshot read and current read. The former is based on mysql mvcc, the read data block is undo block, and the latter is based on the current data block. This article gives a brief account of the relationship between these two different read types and locks.

Contact information

Official account of Wechat

WeChat

Whether the directory snapshot read is locked

Snapshot read will not lock because the operation is not the current data block.

Two types of current read lock

X-exclusive lock

S-shared lock

Several operating scenarios of current read

Query current read lock-holding statements in different operation scenarios

(note: follow column 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 | +- -- +- -+ | 119090x00000836F561 4730x00000836F561 2 | 11909 | X | RECORD | `zxydb`.`t _ read` | GEN_CLUST_INDEX | 473 | 3 | 2 | 0x00000836F561 | 421207096970864 | S | RECORD | `zxydb`.`t _ read` | GEN_CLUST_INDEX | 473 | 3 | | 2 | 0x00000836F561 | +- -+ 2 rows in set 1 warning (0.00 sec)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report