Method and system for reduced lock contention in SQL transactions
First Claim
1. A method for reducing lock contention of concurrent transactions on a plurality of rows of a table in a relational data base system in response to a database query having a set of predicates, the method comprising the steps of:
- (a) scanning all rows of the table within an access range determined by the query;
(b) evaluating each scanned row to determine whether the row satisfies the set of predicates; and
(c) returning the row if it satisfies the set of predicates of the query.
1 Assignment
0 Petitions
Accused Products
Abstract
A method, apparatus, and computer readable medium containing programming instructions for reducing lock contention of concurrent transactions is disclosed. According to the method, apparatus, and computer readable medium of the present invention, a scan is performed by accessing all rows of a table in a relational database, evaluating each row to determine whether the row satifies a set of predicates of a database query, and returning the row if it satisfies the set of predicates. According to a preferred embodiment of the present invention, all rows are evaluated regardless of current locks. The scan is continued if the row does not satisfy the set of predicates. A lock is requested if the row satisfies the set of predicates, and the scan is suspended, if the requested lock is refused. The request is repeated and the row is re-evaluated when the lock is permitted. If thereafter the row still satisfies the set of predicates, the row is returned. If the row no longer satisfies the set of predicates, the lock is released, the row is skipped, and the scan is continued.
The locking semantics according to the invention has the advantage that it completely removes the problem of lock contention on the rows that do not satisfy statement predicates.
93 Citations
24 Claims
-
1. A method for reducing lock contention of concurrent transactions on a plurality of rows of a table in a relational data base system in response to a database query having a set of predicates, the method comprising the steps of:
-
(a) scanning all rows of the table within an access range determined by the query;
(b) evaluating each scanned row to determine whether the row satisfies the set of predicates; and
(c) returning the row if it satisfies the set of predicates of the query. - View Dependent Claims (2, 3, 4, 6, 7, 8)
-
-
5. The method of claim 5, wherein the returning step (c) further comprises the step of:
(c5) releasing the lock, skipping the row, and continuing the scan if the row no longer satisfies the set of predicates of the query.
-
9. An apparatus for reducing lock contention of concurrent transactions on a plurality of rows of a table in a relational data base system in response to a database query having a set of predicates, comprising:
-
means for scanning all rows of the table within an access range determined by the query;
means for evaluating each scanned row to determine whether the row satisfies the set of predicates; and
means for returning the row if it satisfies the set of predicates of the query. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24)
-
-
17. A computer readable medium containing programming instructions for reducing lock contention of concurrent transactions on a plurality of rows of a table in a relational data base system in response to a database query having a set of predicates, the programming instructions for:
-
(a) scanning all rows of the table within an access range determined by the query;
(b) evaluating each scanned row to determine whether the row satisfies the set of predicates; and
(c) returning the row if it satisfies the set of predicates of the query.
-
Specification