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

What are the SQL92 standard isolation levels

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

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "what are the SQL92 standard isolation levels". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the SQL92 standard isolation levels.

Define

Read uncommitted (read uncommitted)

At the Read uncommitted level, changes in a transaction are visible to other transactions, even if they are not committed. Transactions can read uncommitted data, which is also known as Dirty read. This level can cause a lot of problems. Read uncommitted is not much better than other levels in terms of performance, but lacks many of the benefits of other levels, and unless there is a very necessary reason, it is rarely used in practical applications.

Read committed (read submission)

The default isolation level for most database systems is Read committed (but MySQL is not). Read committed satisfies the simple definition of isolation mentioned earlier: at the beginning of a transaction, only changes made by committed transactions can be seen. In other words, any changes made by one transaction from the beginning to the commit are invisible to other transactions. This level is sometimes called Nonrepeatable read, because executing the same query twice may result in different results.

Repeatable read (repeatable)

Repeatable read solves the problem of dirty reading. This level ensures that the results of reading the same record multiple times in the same transaction are consistent. However, in theory, the repeatable isolation level still does not solve another Phantom read problem. The so-called illusory reading means that when a transaction reads a record in a certain range, another transaction inserts a new record in that range, and when the previous transaction reads the record in that range again, it will produce a Phantom row. InnoDB and XtraDB storage engines solve the problem of phantom reading through multi-version concurrency control (MVCC,Multivesion Concurrency Control).

Repeatable read is the default transaction isolation level for Mysql, where InnoDB principally uses MVVC to achieve high concurrency and uses a strategy called next-key-locking to avoid phantom reading.

Serializable (serializable)

Serializable is the highest isolation level. It avoids the phantom reading problem mentioned earlier by forcing transaction serialization. In a nutshell, Serializable puts locks on every row of data it reads, so it can lead to a large number of timeout and lock requisition problems. This isolation level is also rarely used in practical applications, and can only be considered when there is a great need to ensure data consistency and it is acceptable that there is no concurrency.

Isolation level

ANSI SQL92 P68-69

Level (isolation level) Dirty read (dirty read) Non-repeatable read (non-repeatable read) Phantom (phantom read) Read uncommitted (read unsubmitted content) ✓✓✓ Read committed (read submitted content) × ✓✓ Repeatable read (repeatable readable) × ✓ Serializable (serializable) × × × to this, I believe you have a deeper understanding of "SQL92 standard isolation levels", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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