In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what is the isolation level of mysql". In daily operation, I believe many people have doubts about what the isolation level of mysql is. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the questions of "what is the isolation level of mysql?" Next, please follow the editor to study!
READ UNCOMMITTED
The SELECT statement is executed in a non-locked manner, but a possibly earlier version of the record is used. Therefore, using this isolation level, for example, reading is incoherent. This is also known as "dirty read". In addition, this isolation level works like READ COMMITTED; in short, under the isolation level of READ UNCOMMITTED, things are visible to other things until they are turned on but committed. Remember, from a performance point of view, this level is not necessarily better than other isolation levels; it is rarely used in general, except for special business requirements.
READ COMMITTED
An isolation level that is a bit like Oracle. All SELECT... FOR UPDATE and SELECT... The LOCK IN SHARE MOD statement locks only the index record, not the gap before the record, thus allowing new records to be inserted at will next to the locked record. The UPDATE and DELETE statements use a unique index with unique search criteria to lock only the found index record, excluding the gap before the record. In the range type UPDATE and DELETE statements, InnoDB must set next-key locks or gap locks and other user-made block insertions for gaps covered by the scope. This is necessary because for MySQL replication and recovery to work, the "ghost row" must be stopped; in short, READ COMMITTED actually solves the problem of repeatable readability of READ UNCOMMITTED, that is, under the isolation level of READ COMMITTED, when a thing is opened to end, its modifications, updates and deletions are invisible to other things.
REPEATABLE READ
This is the default isolation level for InnoDB. SELECT with unique search criteria using unique index... FOR UPDATE, SELECT... The LOCK INSHARE MODE, UPDATE, and DELETE statements lock only the found index record, not the gap before the record. With other search criteria, these operations use next-key locking, lock the search index range with next-key locking or gap locking, and prevent new insertions by other users. In continuous reading, there is an important difference from the previous isolation level: at this level, all continuous reads within the same transaction take the same snapshot determined by the first read. This convention means that if you issue several unformatted SELECT statements within the same transaction, these SELECT statements are persistent to each other; REPEATABLE READ solves disgusting dirty reads and ensures that the results of the same transaction are consistent when reading the same records. However, it fails to solve the problem of phantom reading, that is, when a transaction is reading a record, another thing is inserting the record, causing a line break when the thing is read again.
SERIALIZABLE
This level is similar to REPEATABLE READ, but all unformatted SELECT statements are implicitly converted to SELECT. LOCK IN SHAREMODE . The highest isolation level, which forces transactions to execute serially, can be said to add row locks to each row data, so it will lead to a lot of lock contention or a large number of timeout problems, and the performance is very poor. If it is not a special business requirement, this situation is not generally chosen.
Attached image (from high-performance mysql):
At this point, the study on "what is the isolation level of mysql" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
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.