Database multi-version concurrency control method, device, server and storage medium
A control method and multi-version technology, applied in the database field, can solve the problem of not really reducing the resource consumption of lock objects
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0046] figure 1 It is a flow chart of a multi-version concurrency control method for a database provided in Embodiment 1 of the present invention. This embodiment is applicable to the multi-version concurrency control of a database, and the method can be executed by a multi-version concurrency control device for a database. Specifically include the following steps:
[0047] S110. When the current transaction is started, lock the transaction number of the current transaction in an exclusive lock manner.
[0048] Among them, a transaction refers to a program execution unit (unit) that accesses and possibly updates various data items in the database. If the transaction encounters an error and is canceled or rolled back, all SQL statement operations of the transaction will be cleared, and the database will be restored to the state before the transaction was executed. Exclusive locks, also known as exclusive locks (X locks for short) or write locks, are a basic type of lock. If a...
Embodiment 2
[0058] figure 2 It is a flow chart of a multi-version concurrency control method for a database provided by Embodiment 2 of the present invention. On the basis of the above-mentioned embodiments, this embodiment provides that when the current operation is insert, all operations are executed according to preset rules. Describe the implementation of the current operation, such as figure 2 As shown, the method specifically includes:
[0059] S210. When the current transaction is started, lock the transaction number of the current transaction in an exclusive lock manner.
[0060] S220. If the current operation of the current transaction is a write operation, generate a transaction savepoint.
[0061] S230. Search for a target data page corresponding to the write operation (insert), and lock the target data page in an exclusive lock manner.
[0062] S240. Insert the data to be inserted into the target data page, write the transaction number of the current transaction into the ...
Embodiment 3
[0087] Figure 4 Shown is a schematic structural diagram of a multi-version concurrency control device for a database provided by Embodiment 3 of the present invention. This embodiment is applicable to the multi-version concurrency control of a database, such as Figure 4 As shown, the multi-version concurrency control device of the database includes:
[0088] The transaction number blocking module 410 is configured to block the transaction number of the current transaction by means of an exclusive lock when the current transaction starts;
[0089] A savepoint generation module 420, configured to generate a transaction savepoint if the current operation of the current transaction is a write operation;
[0090] A data page locking module 430, configured to find a target data page corresponding to the write operation, and lock the target data page in an exclusive lock mode;
[0091] An operation executing module 440, configured to execute the current operation according to a p...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com