Method and system for Boolean expression query optimization
First Claim
1. A computer implemented method for logically evaluating a Boolean expression used in a query statement, wherein the Boolean expression refers to an attribute and includes a plurality of conditions, the method comprising:
- receiving the Boolean expression;
decomposing the Boolean expression into the plurality of conditions;
wherein each condition of the plurality of conditions includes an attribute name, a relational operator, and at least one condition value;
for each condition of the plurality of conditions, extracting at least one condition value referring to the attribute name for a condition of the plurality of conditions, wherein the at least one condition value defines a value range of the condition of the plurality of conditions;
inserting the at least one condition value in a condition value list in sorted order;
initializing, by a computer, a relationship vector for the at least one condition value, wherein each relationship vector component in the relationship vector is a relational operator counter and initializing the relationship vector comprises setting the relational operator counter for each of the relationship vector components to an initial value; and
adjusting the relationship vectors for the at least one condition value and for each further condition value that is in the condition list that is in the value range of the condition of the at least one condition value by adjusting the relational operator counters, wherein adjusting the relationship vectors comprises;
incrementing at least one of the relationship vector components for the at least one condition value by an increment to reflect the condition, andpropagating the increment through each of the relationship vector components for each further condition value in the condition list as long as the further condition value is within the value range of the condition; and
reducing the Boolean expression according to each relationship vector.
2 Assignments
0 Petitions
Accused Products
Abstract
Method and computer system for logically evaluating a Boolean expression used in a query statement to optimize the query. The Boolean expression refers to an attribute and includes a plurality of conditions. The Boolean expression is received (410) and decomposed (420) into the plurality of conditions. For each condition at least one condition value referring to the attribute is extracted (421) from the condition. The at least one condition value is then inserted (422) into a condition value list in sorted order. A relationship vector of the at least one condition value is initialized (423). Then the relationship vectors of the at least one condition value and of each further condition value that is in the condition list and that is in the value range of the condition are adjusted (424). After having processed all conditions the Boolean expression may be reducing (430) according to each relationship vector.
-
Citations
24 Claims
-
1. A computer implemented method for logically evaluating a Boolean expression used in a query statement, wherein the Boolean expression refers to an attribute and includes a plurality of conditions, the method comprising:
-
receiving the Boolean expression; decomposing the Boolean expression into the plurality of conditions; wherein each condition of the plurality of conditions includes an attribute name, a relational operator, and at least one condition value; for each condition of the plurality of conditions, extracting at least one condition value referring to the attribute name for a condition of the plurality of conditions, wherein the at least one condition value defines a value range of the condition of the plurality of conditions; inserting the at least one condition value in a condition value list in sorted order; initializing, by a computer, a relationship vector for the at least one condition value, wherein each relationship vector component in the relationship vector is a relational operator counter and initializing the relationship vector comprises setting the relational operator counter for each of the relationship vector components to an initial value; and adjusting the relationship vectors for the at least one condition value and for each further condition value that is in the condition list that is in the value range of the condition of the at least one condition value by adjusting the relational operator counters, wherein adjusting the relationship vectors comprises; incrementing at least one of the relationship vector components for the at least one condition value by an increment to reflect the condition, and propagating the increment through each of the relationship vector components for each further condition value in the condition list as long as the further condition value is within the value range of the condition; and reducing the Boolean expression according to each relationship vector. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A computer-readable storage medium storing a computer program product for logically evaluating a Boolean expression used in a query statement, the computer program product including executable instructions that, when executed, is configured to cause at least one processor of a computing device to:
-
receive the Boolean expression; decompose the Boolean expression into the plurality of conditions, wherein each condition of the plurality of conditions includes an attribute name, a relational operator, and at least one condition value; for each condition of the plurality of conditions, extracting at least one condition value referring to the attribute name for a condition of the plurality of conditions, wherein the at least one condition value defines a value range of the condition of the plurality of conditions; insert the at least one condition value in a condition value list in sorted order; initialize a relationship vector for the at least one condition value, wherein each relationship vector component in the relationship vector is a relational operator counter and the instructions that cause the processor to initialize the relationship vector comprises instructions that cause the processor to set the relational operator counter for each of the relationship vector components to an initial value; and adjust the relationship vectors for the at least one condition value and for each further condition value that is in the condition list that is in the value range of the condition of the at least one condition value by adjusting the relational operator counters, wherein the instructions that cause the processor to adjust the relationship vectors comprise instructions that cause the processor to; increment at least one of the relationship vector components for the at least one condition value by an increment to reflect the condition, and propagate the increment through each of the relationship vector components for each further condition value in the condition list as long as the further condition value is within the value range of the condition; and reduce the Boolean expression according to each relationship vector.
-
-
14. A computer system for logically evaluating a Boolean expression used in a query statement, wherein the Boolean expressions refers to an attribute and includes a plurality of conditions, comprising:
-
a memory to receive the Boolean expression and to store a condition value list; and
having at least one processor for executing computer program instructions to;decompose the Boolean expression into the plurality of conditions, wherein each condition of the plurality of conditions includes an attribute name, a relational operator, and at least one condition value; for each condition of the plurality, extract at least one condition value referring to the attribute name for a condition of the plurality of conditions, wherein the at least one condition value defines a value range of the condition of the plurality of conditions; insert the at least one condition value in the condition value list in sorted order; initialize a relationship vector for the at least one condition value, wherein each relationship vector component in the relationship vector is a relational operator counter and the instructions that cause the processor to initialize the relationship vector comprises instructions that cause the processor to set the relational operator counter for each of the relationship vector components to an initial value; and adjust the relationship vectors for the at least one condition value and for each further condition value that is in the condition list that is in the value range of the condition of the at least one condition value by adjusting the relational operator counters, wherein the computer program instructions causing the at least one processor to adjust the relationship vectors comprise; a first portion to increment at least one of the relationship vector components for the at least one condition value by an increment to reflect the condition, and a second portion to propagate the increment through each of the relationship vector components for each further condition value in the condition list as long as the further condition value is within the value range of the condition; and wherein the at least one processor further executes computer program instructions to reduce the Boolean expression according to each relationship vector. - View Dependent Claims (15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
-
Specification