US2018203888A1PendingUtilityA1

Multi-Version Concurrency Control Method in Database and Database System

Assignee: HUAWEI TECH CO LTDPriority: Dec 31, 2013Filed: Mar 13, 2018Published: Jul 19, 2018
Est. expiryDec 31, 2033(~7.4 yrs left)· nominal 20-yr term from priority
G06F 11/1469G06F 2201/84G06F 16/2322G06F 16/2365G06F 16/2329G06F 17/30353G06F 17/30371G06F 17/30356
50
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

A multi-version concurrency control method in a database and a database system is presented. The database system sets a data page link of a page, where the data page link includes a page pointer, and a page pointer is used to point to another version page prior to a last operation on the version page. In this way, when a page in the database is read, if a timestamp of a current version page is greater than a timestamp of a read transaction, page-level rollback may be directly performed according to a data page link of the page that is requested to read to roll back to a page that needs to be read, which facilitates queries for data on each version page in the database. Further, the database system may implement record rollback efficiently.

Claims

exact text as granted — not AI-modified
What is claimed is: 
     
         1 . A multi-version concurrency control method in a database, comprising:
 receiving a data writing operation request generated by a write operation transaction, wherein the data writing operation request is used to request to perform a write operation, and wherein the data writing operation request comprises a timestamp of the write operation transaction;   performing the write operation on a current page, which is a latest version before the write operation is performed, to obtain a new page;   setting a timestamp of the new page according to the timestamp of the write operation transaction; and   setting rollback information of the new page, wherein the rollback information comprises a page pointer which points to the current page and a record pointer which points to a previous record, a rollback record, or a to be deleted record.   
     
     
         2 . The method according to  claim 1 , wherein performing the write operation on the current page according to the data writing operation request to obtain the new page comprises updating a record on the current page according to an indication of the data writing operation request to obtain the new page when the data writing operation request requests to update the record, and wherein the record pointer of the new page is set to point to the previous record, which is the record prior to the update on the current page. 
     
     
         3 . The method according to  claim 1 , wherein performing the write operation on the current page according to the data writing operation request to obtain a new page comprises inserting, on the current page, a record that is requested to be inserted by the data writing operation request to obtain the new page and storing the current page and the new page, wherein the record pointer of the new page is set to point to a rollback record corresponding to the inserted record, and wherein the rollback record comprises information that the record that is requested to be inserted by the data writing operation request has been deleted from the current page. 
     
     
         4 . The method according to  claim 1 , wherein performing the write operation on the current page according to the data writing operation request to obtain the new page comprises marking, on the current page, a record that is requested to be deleted by the data writing operation request as deleted to obtain the new page when the data writing operation request requests to delete the record, and wherein the record pointer of the new page is marked as deleted and is set to point to the to be deleted record that is requested to be deleted by the data writing operation request from the current page. 
     
     
         5 . The method according to  claim 1 , wherein setting the timestamp of the new page according to the timestamp of the write operation transaction comprises:
 setting a timestamp of the current page as the timestamp of the new page when the timestamp of the current page is greater than the timestamp of the write operation transaction; and   setting the timestamp of the new page to the timestamp of the write operation transaction when the timestamp of the current page is less than the timestamp of the write operation transaction.   
     
     
         6 . The method according to  claim 1 , further comprising updating the transaction link in the database such that the transaction link comprises an operation transaction pointer of the write operation transaction. 
     
     
         7 . A database system having a database, comprising:
 a memory storing computer readable instructions; and   a processor coupled to the memory and configured to:
 receive a data writing operation request generated by a write operation transaction, wherein the data writing operation request is used to request to perform a write operation, and wherein the data writing operation request comprises a timestamp of the write operation transaction; 
 perform the write operation on a current page, which is a latest version before the write operation is performed, to obtain a new page; 
 set a timestamp of the new page according to the timestamp of the write operation transaction; and 
 set rollback information of the new page, wherein the rollback information comprises a page pointer which points to the current page and a record pointer which points to a previous record, a rollback record, or a to be deleted record. 
   
     
     
         8 . The database system according to  claim 7 , wherein the processor is further configured to update a record on the current page according to an indication of the data writing operation request to obtain the new page when the data writing operation request requests to update the record, and wherein the record pointer of the new page is set to point to the previous record, which is the record prior to the update on the current page. 
     
     
         9 . The database system according to  claim 7 , wherein the processor is further configured to insert, on the current page, a record that is requested to be inserted by the data writing operation request to obtain the new page and storing the current page and the new page, wherein the record pointer of the new page is set to point to a rollback record corresponding to the inserted record, and wherein the rollback record comprises information that the record that is requested to insert by the data writing operation request has been deleted from the current page. 
     
     
         10 . The database system according to  claim 7 , wherein the processor is further configured to mark, on the current page, a record that is requested to be deleted by the data writing operation request as deleted to obtain the new page when the data writing operation request requests to delete the record, and wherein the record pointer of the new page is marked as deleted and is set to point to the to be deleted record that is requested to be deleted by the data writing operation request from the current page. 
     
     
         11 . The database system according to  claim 7 , wherein the processor is further configured to:
 set a timestamp of the current page as the timestamp of the new page when the timestamp of the current page is greater than the timestamp of the write operation transaction; and   set the timestamp of the new page to the timestamp of the write operation transaction when the timestamp of the current page is less than the timestamp of the write operation transaction.   
     
     
         12 . A non-transitory storage medium, comprising computer readable instructions which read by one or more processors to implement:
 receiving a data writing operation request generated by a write operation transaction, wherein the data writing operation request is used to request to perform a write operation, and wherein the data writing operation request comprises a timestamp of the write operation transaction;   performing the write operation on a current page, which is a latest version before the write operation is performed, to obtain a new page;   setting a timestamp of the new page according to the timestamp of the write operation transaction; and   setting rollback information of the new page, wherein the rollback information comprises a page pointer which points to the current page and a record pointer which points to a previous record, a rollback record, or a to be deleted record.   
     
     
         13 . The non-transitory storage medium according to  claim 12 , wherein the one or more processors are further configured to update a record on the current page according to an indication of the data writing operation request to obtain the new page when the data writing operation request requests to update the record, and wherein the record pointer of the new page is set to point to the previous record, which is the record prior to the update on the current page. 
     
     
         14 . The non-transitory storage medium according to  claim 12 , wherein the one or more processors are further configured to insert, on the current page, a record that is requested to be inserted by the data writing operation request to obtain the new page and storing the current page and the new page, wherein the record pointer of the new page is set to point to a rollback record corresponding to the inserted record, and wherein the rollback record comprises information that the record that is requested to be inserted by the data writing operation request has been deleted from the current page. 
     
     
         15 . The non-transitory storage medium according to  claim 12 , wherein the one or more processors are further configured to mark, on the current page, a record that is requested to be deleted by the data writing operation request as deleted to obtain the new page when the data writing operation request requests to delete the record, and wherein the record pointer of the new page is marked as deleted and is set to point to the to be deleted record that is requested to be deleted by the data writing operation request from the current page.

Join the waitlist — get patent alerts

Track US2018203888A1 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.