IP Library › Granted Patent US 11,269,829
Granted Patent B2
US 11,269,829 · App. 13/797,128 · Granted Mar 8, 2022

Row level locking for columnar data

Inventors: Vineet Marwah (San Ramon, CA); Teck Hua Lee (Belmont, CA); Amit Ganesh (San Jose, CA)
Assignee: Oracle International Corporation
G06F16/221
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,269,829
App. No.
13/797,128
Granted
Mar 8, 2022
Kind
B2
Abstract

Row locking is performed at the row level of granularity for database data stored in columnar form. Row level locking entails use of a lock vector that is stored in a compression unit in a data block, the compression unit storing rows in columnar-major format. On an as needed basis, the lock vector is expanded to identify more transactions affecting the rows in the compression unit.

Claims (38)

1. A method comprising steps of:

storing a respective plurality of rows in column-major format in each data block of a plurality of data blocks, wherein each data block of said plurality of data blocks includes a respective lock vector that specifies whether each row of the respective plurality of rows of said each data block is locked; and

at a row-level of granularity, locking a subset of the respective plurality of rows of a particular data block of said plurality of data blocks, wherein locking the respective plurality of rows of said particular data block includes:

a first transaction obtaining a lock on a first row having at least one column value of a column in said particular data block, wherein said first transaction obtaining a lock includes modify the respective lock vector of said particular data block to indicate said first row is locked; and

while said first transaction holds said lock on said first row, a second transaction obtaining a lock on a second row having at least one column value of said column in said particular data block, wherein said second transaction obtaining a lock includes modify said respective lock vector of said particular data block to indicate said second row is locked.

2. The method of claim 1 , wherein each data block of said plurality of data blocks contains a compression unit that contains the respective plurality of rows of said each data block, wherein a compression unit contained in said particular data block contains said first row and said second row.

3. The method of claim 1 , wherein each data block of said plurality of data blocks is associated with a limit on a number of transactions that can concurrently hold a lock on a row in said each data block, wherein the limit associated with a first data block of said plurality of data blocks is different than a limit associated with a second data block of said plurality of data blocks.

4. The method of claim 3 , further including: for another data block of said plurality of data blocks, increasing the limit associated with said another data block.

5. The method of claim 1 , while said first transaction holds said lock on said first row, locking multiple rows of another data block of said plurality of data blocks at a level of granularity higher than said row level of granularity.

6. A method comprising steps of:

storing a plurality of rows in a plurality of data blocks in column-major format, wherein each data block of said plurality of data blocks includes a variable lock vector that is used to identify one or more transactions having a lock on a row in said each data block; and

locking a plurality of rows at a row-level of granularity within a particular data block of said plurality of data blocks, said particular data block containing a particular variable lock vector, wherein locking said plurality of rows at a row-level of granularity includes:

setting a first sequence of bits in said variable lock vector to a first value to lock a first row in said particular data block for a first transaction; and

while said first transaction holds said lock on said first row:

setting a second sequence of bits in said variable lock vector to a second value to lock a second row in said data block for a second transaction; and

increasing a size of the variable lock vector in said particular data block to lock a third row in said particular data block for a third transaction.

7. The method of claim 6 , wherein each data block of said plurality of data blocks contains a compression unit that contains a subset of said plurality of rows, wherein said particular data block contains said first row and said second row.

8. The method of claim 6 , after increasing the size of said variable lock vector in said particular data block, decreasing the size of said variable lock vector in said particular data block.

9. The method of claim 6 , receiving one or more database commands that indicate a minimum size of a variable lock vector.

10. One or more non-transitory storage media storing instructions, which, when executed by one or more computing devices, cause:

storing a respective plurality of rows in column-major format in each data block of a plurality of data blocks, wherein each data block of said plurality of data blocks includes a respective lock vector that specifies whether each row of the respective plurality of rows of said each data block is locked; and

at a row-level of granularity, locking a subset of the respective plurality of rows of a particular data block of said plurality of data blocks, wherein locking the respective plurality of rows of said particular data block includes:

a first transaction obtaining a lock on a first row having at least one column value of a column in said particular data block, wherein said first transaction obtaining a lock includes modify the respective lock vector of said particular data block to indicate said first row is locked; and

while said first transaction holds said lock on said first row, a second transaction obtaining a lock on a second row having at least one column value of said column in said particular data block, wherein said second transaction obtaining a lock includes modify said respective lock vector of said particular data block to indicate said second row is locked.

11. The one or more non-transitory storage media of claim 10 , wherein each data block of said plurality of data blocks contains a compression unit that contains the respective plurality of rows of said each data block, wherein a compression unit contained in said particular data block contains said first row and said second row.

12. The one or more non-transitory storage media of claim 10 , wherein each data block of said plurality of data blocks is associated with a limit on a number of transactions that can concurrently hold a lock on a row in said each data block, wherein the limit associated with a first data block of said plurality of data blocks is different than a limit associated with a second data block of said plurality of data blocks.

13. The one or more non-transitory storage media of claim 12 , the instructions further including instructions that when executed by said one or more computing devices, cause, for another data block of said plurality of data blocks, increasing the limit associated with said another data block.

14. The one or more non-transitory storage media of claim 10 , the instructions further including instructions that when executed by said one or more computing devices, cause, while said first transaction holds said lock on said first row, locking multiple rows of another data block of said plurality of data blocks at a level of granularity higher than said row level of granularity.

15. One or more non-transitory storage media storing instructions, which, when executed by one or more computing devices, cause:

storing a plurality of rows in a plurality of data blocks in column-major format, wherein each data block of said plurality of data blocks includes a variable lock vector that is used to identify one or more transactions having a lock on a row in said each data block; and

locking a plurality of rows at a row-level of granularity within a particular data block of said plurality of data blocks, said particular data block containing a particular variable lock vector, wherein locking said plurality of rows at a row-level of granularity includes:

setting a first sequence of bits in said variable lock vector to a first value to lock a first row in said particular data block for a first transaction; and

while said first transaction holds said lock on said first row:

setting a second sequence of bits in said variable lock vector to a second value to lock a second row in said data block for a second transaction; and

increasing a size of the variable lock vector in said particular data block to lock a third row in said particular data block for a third transaction.

16. The one or more non-transitory storage media of claim 15 , wherein each data block of said plurality of data blocks contains a compression unit that contains a subset of said plurality of rows, wherein said particular data block contains said first row and said second row.

17. The one or more non-transitory storage media of claim 15 , the instructions further including instructions that when executed by said one or more computing devices, cause, after increasing the size of said variable lock vector in said particular data block, decreasing the size of said variable lock vector in said particular data block.

18. The one or more non-transitory storage media of claim 15 , the instructions further including instructions that, when executed by said one or more computing devices, cause, receiving one or more database commands that indicate a minimum size of a variable lock vector.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 26, 2013
From: MARWAH, VINEET; LEE, TECK HUA; GANESH, AMIT
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 030091/0001 →
Continuity (1)
Related Publication 20140279960A1 · Sep 18, 2014