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

Differences in the implementation of mainstream relational database locks

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

The lock realized by SQL Server is mainly realized by locking table, and a special area is opened up in memory. For the corresponding lock records of different levels of objects (row, key-block-object, index-library), the transaction layer and storage layer are completely separated, and the lock occupies a large overhead. When the lock takes up more resources, lock upgrade will be carried out to reduce concurrency.

The implementation of MySQL and lock is mainly the implementation of row keys, which uses the way of recording bitmap in the page header. When retrieving row lock records, the page header needs to get data from the page header. Because the page head records row locks with bitmap information, it saves more resources than SQL Server and does not need to upgrade the lock. In addition, the implementation of gap lock can well support the promotion of high-level isolation level and concurrency, such as RR isolation level.

Oracle implements the lock by combining the transaction layer and the storage layer. The lock information is in the ITL transaction slot and row information of the block, which greatly saves memory resources and lock resources. The lock almost does not take up any resources. The lock information is completely combined with the transaction slot and row flags, unlike MySQL, which has separate memory lock table separation to deal with, in rac mode. It is very convenient to synchronize, store and transaction the transaction and lock information except data, which makes the design of rac single and effective, but the disadvantage is that it is too close to combine the transaction layer and storage layer to make the transaction-based expansion very difficult.

The lock design of PostgreSQL does not record the row lock information in memory, and the row lock information is obtained from the transactionid information on the row, which saves memory resources. When indexing back to the table, mvcc technology is used to avoid the common snapshot now mode or other disadvantages that non-mvcc needs to use locking. For

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