In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the knowledge of "how to use mysql insertion intention lock". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. The insertion intention lock is a Gap lock, not an intention lock, but the result of an insert operation. When multiple transactions write different data to the same index gap at the same time, there is no need to wait for other transactions to complete, and lock waiting does not occur.
Suppose that a record index contains keys 4 and 7, and different transactions insert 5 and 6, respectively, and each transaction generates an insert intention lock, which is added to 4-7 to get an exclusive lock on the inserted row, but does not lock each other, because the data rows do not conflict.
2. Inserting an intention lock will not block any lock, and inserting a record will hold a record lock.
Example
Insert into test_user (user_id,name,age) values-TRX HAS BEEN WAITING 18 SEC FOR THIS LOCK TO BE GRANTED:RECORD LOCKS space id 6628 page no 4 n bits 72 index `index_ user`of table `test`.`test _ user` trx id 117851203 insert intention lock lock_mode X insert intention waitingRecord lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0 0: len 8; hex 73757072656d756d; asc supremum This is the end of the content of "how to use mysql insert intention Lock". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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: 289
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.