Systems and methods of increasing database access concurrency using granular timestamps
First Claim
1. A method of reading and writing data from a database table comprising:
- initiating a read transaction to read from a first non-key column of a first row in the database table, the database table having a plurality of rows, each row comprising a primary key and a plurality of non-key columns, wherein;
each non-key column comprises one or more column values,each column value has a respective timestamp that identifies when the respective column value was stored, andthe respective timestamps of the column values in each non-key column provide a unique order for the column values that comprise the non-key column,the initiating including;
determining that a write transaction is in progress that is updating a second non-key column of the first row in the database table, wherein the second non-key column is distinct from the first non-key column and the write transaction that is updating the second non-key column holds a lock on the second non-key column of the first row of the database table, anddetermining that no lock is held on the first non-key column of the first row; and
in response to determining that no lock is held on the first non-key column of the first row, concurrently reading the data from the first non-key column and writing a new column value to the second non-key column;
wherein each non-key column further comprises a last-write timestamp that indicates when the last write occurred for the respective non-key column;
wherein initiating the read transaction further comprises selecting a read timestamp based in part on the last-write timestamp of the first non-key column; and
wherein reading the data from the first non-key column comprises selecting a column value from the first non-key column corresponding to the read timestamp.
2 Assignments
0 Petitions
Accused Products
Abstract
A method reads and writes data from a database table. Each row in the table has a primary key and multiple non-key columns. Each non-key column has one or more column values, and each column value has an associated timestamp that identifies when the column value was stored. The timestamps associated with the column values in each non-key column provide a unique order for the column values. A read transaction is initiated to read from a first non-key column of a first row. A write transaction is in progress that is updating a second non-key column of the first row, where the second non-key column is distinct from the first non-key column. The write transaction holds a lock on the second non-key column of the first row. The method concurrently reads the data from the first non-key column and writes a new column value to the second non-key column.
60 Citations
17 Claims
-
1. A method of reading and writing data from a database table comprising:
-
initiating a read transaction to read from a first non-key column of a first row in the database table, the database table having a plurality of rows, each row comprising a primary key and a plurality of non-key columns, wherein; each non-key column comprises one or more column values, each column value has a respective timestamp that identifies when the respective column value was stored, and the respective timestamps of the column values in each non-key column provide a unique order for the column values that comprise the non-key column, the initiating including; determining that a write transaction is in progress that is updating a second non-key column of the first row in the database table, wherein the second non-key column is distinct from the first non-key column and the write transaction that is updating the second non-key column holds a lock on the second non-key column of the first row of the database table, and determining that no lock is held on the first non-key column of the first row; and in response to determining that no lock is held on the first non-key column of the first row, concurrently reading the data from the first non-key column and writing a new column value to the second non-key column; wherein each non-key column further comprises a last-write timestamp that indicates when the last write occurred for the respective non-key column; wherein initiating the read transaction further comprises selecting a read timestamp based in part on the last-write timestamp of the first non-key column; and wherein reading the data from the first non-key column comprises selecting a column value from the first non-key column corresponding to the read timestamp. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A database management system, comprising one or more server computers, each server computer including:
-
one or more processors; memory; a database table stored in the memory, the database table having a plurality of rows, each row comprising a primary key and a plurality of non-key columns, wherein; each non-key column comprises one or more column values, each column value has a respective timestamp that identifies when the associated column value was stored, and the respective timestamps of the column values in each non-key column provide a unique order for the column values that comprise the non-key column; and one or more programs stored in the memory for execution by the one or more processors, the one or more programs comprising instructions for; initiating a read transaction to read from a first non-key column of a first row in the database table, including; determining that a write transaction is in progress that is updating a second non-key column of the first row in the database table, wherein the second non-key column is distinct from the first non-key column and the write transaction that is updating the second non-key column holds a lock on the second non-key column of the first row of the database table, and determining that no lock is held on the first non-key column of the first row; and in response to determining that no lock is held on the first non-key column of the first row, concurrently reading the data from the first non-key column and writing a new column value to the second non-key column; wherein each non-key column further comprises a last-write timestamp that indicates when the last write occurred for the respective non-key column; wherein initiating the read transaction further comprises selecting a read timestamp based in part on the last-write timestamp of the first non-key column; and wherein reading the data from the first non-key column comprises selecting a column value from the first non-key column corresponding to the read timestamp. - View Dependent Claims (11, 12, 13)
-
-
14. A non-transitory computer readable storage medium storing one or more programs configured for execution by one or more server computers, each server computer having one or more processors and memory storing one or more programs for execution by the one or more processors, the one or more programs comprising instructions for:
-
maintaining a database table, the database table having a plurality of rows, each row comprising a primary key and a plurality of non-key columns, wherein; each non-key column comprises one or more column values, each column value has a respective timestamp that identifies when the associated column value was stored, and the respective timestamps of the column values in each non-key column provide a unique order for the column values that comprise the non-key column; initiating a read transaction to read from a first non-key column of a first row in the database table, including; determining that a write transaction is in progress that is updating a second non-key column of the first row in the database table, wherein the second non-key column is distinct from the first non-key column and the write transaction that is updating the second non-key column holds a lock on the second non-key column of the first row of the database table, and determining that no lock is held on the first non-key column of the first row; and in response to determining that no lock is held on the first non-key column of the first row, concurrently reading the data from the first non-key column and writing a new column value to the second non-key column; wherein each non-key column further comprises a last-write timestamp that indicates when the last write occurred for the respective non-key column; wherein initiating the read transaction further comprises selecting a read timestamp based in part on the last-write timestamp of the first non-key column; and wherein reading the data from the first non-key column comprises selecting a column value from the first non-key column corresponding to the read timestamp. - View Dependent Claims (15, 16, 17)
-
Specification