Database system with transaction control block index
First Claim
1. A method for implementation by one or more hardware data processors forming part of at least one computing device, the method comprising:
- handling a first transaction in a database, the first transaction comprising a plurality of operations on at least a first record in the database, and the first transaction being handled concurrently with at least a second transaction;
assigning, to the first record, a first timestamp, the first timestamp being a temporary timestamp corresponding to the first transaction, the first timestamp being converted from the temporary timestamp to a final timestamp by at least performing a commit operation with respect to the first transaction, and the converting from the temporary timestamp to the final timestamp comprising;
entering a commit lock;
determining a commit timestamp by at least increasing, by a first increment, the value of the commit timestamp generator;
issuing a write memory barrier;
setting, based at least on the commit timestamp, the final timestamp for the first record;
increasing, by a second increment, the value of the commit timestamp generator value; and
releasing the commit lock; and
determining that the first record is available as part of a consistent view for the second transaction, the determining being based at least on a second timestamp of the consistent view being higher than the first timestamp of the first record; and
in response to determining that the first record is available as part of the consistent view for the second transaction, including the first record in the consistent view for the second transaction, the inclusion of the first record in the consistent view enabling the first record to be accessed by the second transaction.
2 Assignments
0 Petitions
Accused Products
Abstract
A plurality of transactions is handled in a database. Each transaction includes a plurality of operations on at least one record in the database with at least two of the transactions being handled concurrently. Thereafter, a temporary timestamp is assigned to each record. The temporary timestamp are based, at least in part, on the corresponding transaction. Further, a final timestamp is assigned to each record with a commit operation. It can later be determined, using a visibility function and based on the assigned temporary timestamps and final timestamps, which of the records are visible in a consistent view for a first transaction. Based on such determination, access can be provided to those records determined to be visible to be accessed to the first transaction.
-
Citations
17 Claims
-
1. A method for implementation by one or more hardware data processors forming part of at least one computing device, the method comprising:
-
handling a first transaction in a database, the first transaction comprising a plurality of operations on at least a first record in the database, and the first transaction being handled concurrently with at least a second transaction; assigning, to the first record, a first timestamp, the first timestamp being a temporary timestamp corresponding to the first transaction, the first timestamp being converted from the temporary timestamp to a final timestamp by at least performing a commit operation with respect to the first transaction, and the converting from the temporary timestamp to the final timestamp comprising; entering a commit lock; determining a commit timestamp by at least increasing, by a first increment, the value of the commit timestamp generator; issuing a write memory barrier; setting, based at least on the commit timestamp, the final timestamp for the first record; increasing, by a second increment, the value of the commit timestamp generator value; and releasing the commit lock; and determining that the first record is available as part of a consistent view for the second transaction, the determining being based at least on a second timestamp of the consistent view being higher than the first timestamp of the first record; and in response to determining that the first record is available as part of the consistent view for the second transaction, including the first record in the consistent view for the second transaction, the inclusion of the first record in the consistent view enabling the first record to be accessed by the second transaction. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A non-transitory computer program product storing instructions which, when executed by at least one hardware data processor forming part of at least one computing device, result in operations comprising:
-
handling a first transaction in a database, the first transaction comprising a plurality of operations on at least a first record in the database, and the first transaction being handled concurrently with at least a second transaction; assigning, to the first record, a first timestamp, the first timestamp being a temporary timestamp corresponding to the first transaction, the first time stamp being converted from the temporary timestamp to a final timestamp by at least performing a commit operation with respect to the first transaction, and the converting from the temporary timestamp to the final timestamp comprising; entering a commit lock; determining a commit timestamp by at least increasing, by a first increment, the value of the commit timestamp generator; issuing a write memory barrier; setting, based at least on the commit timestamp, the final timestamp for the first record; increasing, by a second increment, the value of the commit timestamp generator value; and releasing the commit lock; and
;determining that the first record is available as part of a consistent view for the second transaction, the determining being based at least on a second timestamp of the consistent view being higher than the first timestamp of the first record; and in response to determining that the first record is available as part of the consistent view for the second transaction, including the first record in the consistent view for the second transaction, the inclusion of the first record in the consistent view enabling the first record to be accessed by the second transaction. - View Dependent Claims (8, 9, 10, 11, 12)
-
-
13. A system comprising:
-
at least one hardware data processor; and memory storing instructions which, when executed by the at least one hardware data processor forming part of at least one computing device, result in operations comprising; handling a first transaction in a database, the first transaction comprising a plurality of operations on at least a first record in the database, and the first transaction being handled concurrently with at least a second transaction; assigning, to the first record, a first timestamp, the first timestamp being a temporary timestamp corresponding to the first transaction, the first timestamp being converted from the temporary to a final timestamp by at least performing a commit operation with respect to the first transaction, and the converting from the temporary timestamp to the final timestamp comprising; entering a commit lock; determining a commit timestamp by at least increasing, by a first increment, the value of the commit timestamp generator; issuing a write memory barrier; setting, based at least on the commit timestamp, the final timestamp for the first record; increasing, by a second increment, the value of the commit timestamp generator value; and releasing the commit lock; and
;determining that the first record is available as part of a consistent view for the second transaction, the determining being based at least on a second timestamp of the consistent view being higher than the first timestamp of the first record; and in response to determining that the first record is available as part of the consistent view for the second transaction, including the first record in the consistent view for the second transaction, the inclusion of the first record in the consistent view enabling the first record to be accessed by the second transaction. - View Dependent Claims (14, 15, 16, 17)
-
Specification