US 7,519,583 B2
Detecting and tracking monotonicity for accelerating range and inequality queries
Bishwaranjan Bhattacharjee, Yorktown Heights, N.Y. (US); and Timothy Ray Malkemus, Round Rock, Tex. (US)
Assigned to International Business Machines Corporation, Armonk, N.Y. (US)
Filed on Jul. 14, 2006, as Appl. No. 11/486,855.
Prior Publication US 2008/0016030 A1, Jan. 17, 2008
Int. Cl. G06F 17/30 (2006.01)
U.S. Cl. 707—3  [707/2; 708/3] 1 Claim
OG exemplary drawing
 
1. A computer implemented method for detecting monotonicity, the computer implemented method comprising:
receiving an operation from a user wherein the operation is any of an insert operation, delete operation, update operation, and load operation:
responsive to receiving the operation, determining whether function that is assumed to be monotonic will remain monotonic after performing the operation, wherein the function is part of a generated column that is generated from a base column;
responsive to determining that the function will remain monotonic after performing the operation, allowing the operation to be performed;
responsive to allowing the operation, updating a minimum values and a maximum values of the function and updating an index, wherein the index is the index on x values of the function with a function value as an additional field;
responsive to determining the function will become non-monotonic after the operation, allowing the operation, marking the function as non-monotonic, and invalidating a cached query plan;
receiving a query on the function from the user;
responsive to receiving the query, determining whether the function is monotonic and whether the function includes a range condition or an inequality condition;
responsive to determining that the function is monotonic and a determination that the function includes a range condition or an inequality condition, translating the query from a base column to a generated column using an index;
responsive to translating the query, using the index for answering the query;
responsive to determining that the function is non-monotonic and determining that the function includes the range condition or the inequality condition, maintaining an original query predicate of the query; and
retrieving data specified in the query.