Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

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

Active Publication Date: 2020-07-31
SHANGHAI DAMENG DATABASE
View PDF5 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

But in general, the blocking overhead of a transaction is positively related to the number of records modified by the transaction, which cannot really reduce the resource consumption of the lock object

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Database multi-version concurrency control method, device, server and storage medium
  • Database multi-version concurrency control method, device, server and storage medium
  • Database multi-version concurrency control method, device, server and storage medium

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a multi-version concurrency control method and device for a database, a server and a storage medium. The method comprises the steps of blocking a transaction number of a current transaction in an exclusive lock mode when the current transaction is started; if a current operation of the current transaction is a write operation, generating a transaction save point; searchingfor a target data page corresponding to the write operation, and locking the target data page in the exclusive lock mode; executing the current operation according to a preset rule. Through this blocking mechanism, the number of locks is not directly related to the number of records modified by transactions, the number of the locks can be greatly decreased, blocking conflicts and blocking resourceconsumption are reduced, and the concurrency efficiency of a database management system is improved.

Description

technical field [0001] The present invention relates to the technical field of databases, in particular to a multi-version concurrency control method, device, server and storage medium for databases. Background technique [0002] Multi-Version Concurrency Control (MVCC) can provide high concurrent read and write access performance on the premise of ensuring data consistency, and is an important technical means to improve database concurrency performance. At present, all mainstream database management systems basically implement the MVCC mechanism, but there are obvious differences in the MVCC implementation mechanisms of various products. For example, PostgreSQL and SQL Server implement MVCC based on physical records, and directly store multiple versions of physical records in the system; Oracle, InnoDB, and Dameng Database (DM7) implement MVCC based on rollback records, and the system only saves the latest version of physical records , use the rollback record to save the h...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/23
CPCG06F16/2329
Inventor 王海龙韩朱忠薛慧
Owner SHANGHAI DAMENG DATABASE
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products