CPC G06F 16/2308 (2019.01) [G06F 16/2282 (2019.01); G06F 16/24554 (2019.01)] | 20 Claims |
1. One or more non-transitory computer-readable media storing computer-executable instructions that, when executed by a processor, perform a method for utilizing partition-based locking mechanisms to improve execution of overlapping data definition language (DDL) and data manipulation language (DML) operations on a partitioned database table, the method comprising:
receiving, by a first database node, one or more DML statements associated with a first transaction on a first table partition;
acquiring, by the first database node, a first-node intent exclusive lock on table metadata associated with the partitioned database table for the first transaction;
in response to receiving, by a second database node, a DDL statement associated with a second transaction operating on the partitioned database table:
acquiring, by the second database node, a second-node exclusive lock on second-node table metadata associated with the partitioned database table;
acquiring, by the second database node, a second-node intent exclusive lock on table data of the first table partition;
acquiring, by the first database node, a first-node exclusive lock on first-node table metadata;
executing, by the second database node, operations associated with a first one of the one or more DML statements; and
in response to determining that the operations associated with the one or more DML statements have successfully completed, committing the second transaction;
acquiring, by the first database node, an exclusive lock on first-node table metadata data;
acquiring, by the second database node, an all-partition exclusive lock on table data of each of the partitions of the partitioned table;
executing, by the first database node, operations associated with the DDL statement; and
in response to determining that the operations associated with the DDL statement have successfully completed, committing the first transaction.
|