IP Library › Granted Patent US 9,342,549
Granted Patent B2
US 9,342,549 · App. 14/212,861 · Granted May 17, 2016

Partition level operation with concurrent activities

Inventors: Amit Pathak (Pune, IN); Paresh Rathod (Pune, IN); Swati Sharma (Pune, IN); Nikhil Jamadagni (Fremont, CA)
Assignee: SAP SE
G06F17/30362G06F17/30339G06F17/30371G06F17/30584G06F17/30171
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 9,342,549
App. No.
14/212,861
Granted
May 17, 2016
Kind
B2
Abstract

Techniques of implementing partition level operations with concurrent activities are disclosed. A first operation can be performed on a first partition of a table of data. The first partition can be one of a plurality of partitions of the table, where each partition has a plurality of rows. A first partition level lock can be applied to the first partition for a period in which the first operation is being performed on the first partition, thereby preventing any operation other than the first operation from being performed on the first partition during the period the first partition level lock is being applied to the first partition. A second operation can be performed on a second partition of the table at a point in time during which the first operation is being performed on the first partition.

Claims (82)

1. A computer-implemented method comprising:

performing a first operation on a first partition of a table of data, the first partition being one of a plurality of partitions of the table, each partition in the plurality of partitions having a plurality of rows;

applying, by a machine having a memory and at least one processor, a first partition level lock to the first partition for a period in which the first operation is being performed on the first partition, the first partition level lock preventing any operation other than the first operation from being performed on the first partition during the period the first partition level lock is being applied to the first partition;

performing a second operation on a second partition of the table at a point in time during which the first operation is being performed on the first partition, the second partition being one of the plurality of partitions of the table;

performing a first update of a schema of the table based on the performance of the first operation on the first partition;

applying a schema level lock to the schema of the table for a period covering the performance of the first update of the schema, the schema level lock preventing any update other than the first update from being performed on the schema during the performance of the first update on the schema; and

delaying a performance of a second update of the schema until after a completion of the first update based on the application of the schema level lock to the schema, the second update being based on the performance of the second operation on the second partition.

2. The method of claim 1 , wherein the first operation and the second operation each comprise one of an insert operation, a select operation, an update operation, a delete operation, a split operation, a merge operation, a move operation, a truncate operation, or a drop operation.

3. The method of claim 1 , wherein the first partition level lock is applied to the first partition based on a predefined threshold number of row level locks being applied to rows within the first partition.

4. The method of claim 1 , further comprising:

receiving a request to perform a third operation on the first partition during the performance of the first operation on the first partition;

determining that the first partition level lock is being applied to the first partition at the time the request to perform the third operation is received;

storing a log record of the request based on the determination that the first partition level lock is being applied to the first partition;

determining that the first partition level lock has been released from the first partition; and

performing the third operation on the first partition based on the stored log record of the request and the determination that the first partition level lock has been released from the first partition.

5. The method of claim 1 , further comprising:

storing a corresponding set of partition level statistics for each partition in the plurality of partitions, each set of partition level statistics comprising statistics specific to the partition to which the set corresponds;

storing a set of table level statistics for the table;

updating the corresponding set of partition level statistics for the first partition based on the performance of the first operation on the first partition;

merging the corresponding set of partition level statistics for the first partition with the set of table level statistics;

updating the corresponding set of partition level statistics for the second partition based on the performance of the second operation on the second partition; and

merging the corresponding set of partition level statistics for the second partition with the set of table level statistics.

6. The method of claim 1 , further comprising:

in response to the first operation on the first partition completing, determining that the second operation is still being performed on the second partition;

delaying a rebuilding of a global index of the table in response to the determination that the second operation is being performed on the second partition;

in response to the second operation on the second partition completing, determining that no other operations are being performed on any of the partitions of the table; and

performing the rebuilding of the global index of the table in response to the determination that no other operations are being performed on any of the partitions of the table, the rebuilding of the global index involving an effect of the performance of the first operation on the first partition and an effect of the performance of the second operation on the second partition.

7. The method of claim 1 , further comprising:

generating a first clone of original metadata of the table based on the performance of the first operation on the first partition;

generating a second clone of the original metadata of the table based on the performance of the second operation on the second partition;

generating new metadata of the table based on a merge of the first clone and the second clone; and

discarding the original metadata.

8. The method of claim 1 , further comprising:

performing a third operation on a third partition of the table, the third partition being one of the plurality of partitions of the table;

determining that an identity of the third partition is unknown; and

in response to the determination that the identity of the third partition is unknown, applying a covering partition lock on all partitions of the table for a period in which the third operation is being performed on the third partition, the covering partition lock preventing any operation other than the third operation from being performed on any of the partitions of the table during the period the covering partition lock is being applied.

9. A system comprising:

a machine having a memory and at least one processor; and

at least one module on the machine, the at least one module being configured to:

perform a first operation on a first partition of a table of data, the first partition being one of a plurality of partitions of the table, each partition in the plurality of partitions having a plurality of rows;

apply a first partition level lock to the first partition for a period in which the first operation is being performed on the first partition, the first partition level lock preventing any operation other than the first operation from being performed on the first partition during the period he first partition level lock is being applied to the first partition;

perform a second operation on a second partition of the table at a point in time during which the first operation is being performed on the first partition, the second partition being one of the plurality of partitions of the table;

perform a first update of a schema of the table based on the performance of the first operation on the first partition;

apply a schema level lock to the schema of the table for a period covering the performance of the first update of the schema, the schema level lock preventing any update other than the first update from being performed on the schema during the performance of the first update on the schema; and

delay a performance of a second update of the schema until after a completion of the first update based on the application of the schema level lock to the schema, the second update being based on the performance of the second operation on the second partition.

10. The system of claim 9 , wherein the first operation and the second operation each comprise one of an insert operation, a select operation, an update operation, a delete operation, a split operation, a merge operation, a move operation, a truncate operation, or a drop operation.

11. The system of claim 9 , wherein the first partition level lock is applied to the first partition based on a predefined threshold number of row level locks being applied to rows within the first partition.

12. The system of claim 9 , wherein the at least one module is further configured to:

receive a request to perform a third operation on the first partition during the performance of the first operation on the first partition;

determine that the first partition level lock is being applied to the first partition at the time the request to perform the third operation is received;

store a log record of the request based on the determination that the first partition level lock is being applied to the first partition;

determine that the first partition level lock has been released from the first partition; and

perform the third operation on the first partition based on the stored log record of the request and the determination that the first partition level lock has been released from the first partition.

13. The system of claim 9 , wherein the at least one module is further configured to:

store a corresponding set of partition level statistics for each partition in the plurality of partitions, each set of partition level statistics comprising statistics specific to the partition to which the set corresponds;

store a set of table level statistics for the table;

update the corresponding set of partition level statistics for the first partition based on the performance of the first operation on the first partition;

merge the corresponding set of partition level statistics for the first partition with the set of table level statistics;

update the corresponding set of partition level statistics for the second partition based on the performance of the second operation on the second partition; and

merge the corresponding set of partition level statistics for the second partition with the set of table level statistics.

14. The system of claim 9 , wherein the at least one module is further configured to:

in response to the first operation on the first partition completing, determine that the second operation is still being performed on the second partition;

delay a rebuilding of a global index of the table in response to the determination that the second operation is being performed on the second partition;

in response to the second operation on the second partition completing, determine that no other operations are being performed on any of the partitions of the table; and

perform the rebuilding of the global index of the table in response to the determination that no other operations are being performed on any of the partitions of the table, the rebuilding of the global index involving an effect of the performance of the first operation on the first partition and an effect of the performance of the second operation on the second partition.

15. The system of claim 9 , wherein the at least one module is further configured to:

generate a first clone of original metadata of the table based on the performance of the first operation on the first partition;

generate a second clone of the original metadata of the table based on the performance of the second operation on the second partition;

generate new metadata of the table based on a merge of the first clone and the second clone; and

discard the original metadata.

16. The system of claim 9 , wherein the at least one module is further configured to:

perform a third operation on a third partition of the table, the third partition being one of the plurality of partitions of the table;

determine that an identity of the third partition is unknown; and

in response to the determination that the identity of the third partition is unknown, apply a covering partition lock on all partitions of the table for a period in which the third operation is being performed on the third partition, the covering partition lock preventing any operation other than the third operation from being performed on any of the partitions of the table during the period the covering partition lock is being applied.

17. A non-transitory machine-readable storage medium, tangibly embodying a set of instructions that, when executed by at least one processor, causes the at least one processor to perform a set of operations comprising:

performing a first operation on a first partition of a table of data, the first partition being one of a plurality of partitions of the table, each partition in the plurality of partitions having a plurality of rows;

applying a first partition level lock to the first partition for a period in which the first operation is being performed on the first partition, the first partition level lock preventing any operation other than the first operation from being performed on the first partition during the period he first partition level lock is being applied to the first partition;

performing a second operation on a second partition of the table at a point in time during which the first operation is being performed on the first partition, the second partition being one of the plurality of partitions of the table;

performing a first update of a schema of the table based on the performance of the first operation on the first partition;

applying a schema level lock to the schema of the table for a period covering the performance of the first update of the schema, the schema level lock preventing any update other than the first update from being performed on the schema during the performance of the first update on the schema; and

delaying a performance of a second update of the schema until after a completion of the first update based on the application of the schema level lock to the schema, the second update being based on the performance of the second operation on the second partition.

18. The storage medium of claim 17 , wherein the first operation and the second operation each comprise one of an insert operation, a select operation, an update operation, a delete operation, a split operation, a merge operation, a move operation, a truncate operation, or a drop operation.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 16, 2015
From: PATHAK, AMIT; RATHOD, PARESH; SHARMA, SWATI; JAMADAGNI, NIKHIL
To: SYBASE, INC.
Reel/Frame 037043/0833 →
Continuity (1)
Related Publication 20150261807A1 · Sep 17, 2015