Unlock instant, AI-driven research and patent intelligence for your innovation.

Method and device for checking constraint relation of database

A technology that constrains relationships and databases, applied in the field of databases, can solve problems such as database performance impact, and achieve the effect of ensuring effectiveness

Active Publication Date: 2022-05-03
BEIJING OCEANBASE TECH CO LTD
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

For example, for foreign key constraints, when a row of data records is added to a child table, a shared lock needs to be added to the data records corresponding to the parent table and even the entire table to prevent the parent table from being modified or deleted, thereby ensuring the validity of the constraint relationship check. Locking usually causes the performance of the database to be affected

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
  • Method and device for checking constraint relation of database
  • Method and device for checking constraint relation of database
  • Method and device for checking constraint relation of database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0031] The solutions provided in this specification will be described below in conjunction with the accompanying drawings.

[0032] As mentioned above, in the traditional technology, when checking the constraint relationship against the database, it is usually necessary to lock the relevant data records to ensure the validity of the constraint relationship detection, which will affect the performance of the database.

[0033] In order not to affect the performance of the database, the inventor of the present application proposes to add a corresponding transaction version number to the data records in the database. Specifically, when a transaction is started to add or modify a row of data records, the corresponding transaction version number is determined for the newly added data record or the modified data record, and the transaction version number is added thereto. Afterwards, the newly added (or modified) data records after adding the transaction version number are stored in...

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 embodiment of the invention provides a constraint relation checking method and device for a database, in the constraint relation checking method, DML operation of a first transaction is executed for a target data table in the database, and each data record stored in each data table in the database has a transaction version number. And entering a submission stage, and determining a corresponding current transaction version number for the target data record after the DML operation in the submission stage. And based on the current transaction version number, reading all relevant data records which are visible and newest to the first transaction from a target data table or an associated data table thereof. Wherein the target data record and the field value, corresponding to the target field, of each related data record have a mutual restriction relationship. And based on each related data record, performing constraint relation check on a target field value, corresponding to the target field, of the target data record. And if the constraint relationship check is passed, submitting the first transaction, otherwise, rolling back.

Description

technical field [0001] One or more embodiments of this specification relate to the field of databases, and in particular, to a method and device for checking constraint relationships in a database. Background technique [0002] General relational databases provide a series of constraint definitions to limit the integrity of data in the database. In order to ensure that the constraints are not broken, after adding, deleting, and modifying operations on the database, it is usually necessary to check the constraint relationship of the data records after the adding, deleting, and modifying operations. [0003] In the traditional technology, when checking the constraint relationship, the relevant data records are usually locked. For example, for foreign key constraints, when a row of data records is added to a child table, a shared lock needs to be added to the data records corresponding to the parent table and even the entire table to prevent the parent table from being modifie...

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
IPC IPC(8): G06F16/21G06F16/22G06F16/28
CPCG06F16/219G06F16/2282G06F16/284
Inventor 阳振坤韩富晟魏宇臣孔繁宇
Owner BEIJING OCEANBASE TECH CO LTD