Techniques of optimizing queries using NULL expression analysis
First Claim
1. A method for processing queries comprising performing a machine-executed operation involving instructions, wherein the machine-executed operation is at least one of:
- A) sending the instructions over transmission media;
B) receiving the instructions over transmission media;
C) storing the instructions onto a machine-readable storage medium; and
D) executing the instructions;
wherein the instructions are instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of;
receiving a query that specifies a target set of data, wherein the query includes a count operator that is to be performed over a first set of values;
wherein the count operator specifies a first expression which, when evaluated over the target set of data, would generate the first set of values;
generating a first representation of the query, wherein the first representation indicates that the count operator is to be performed based on the first expression;
determining a second expression based at least on the first expression, wherein the second expression is such that the first expression would evaluate to any NOT NULL value if and only if the second expression would evaluate to any NOT NULL value; and
based on the first representation, generating a second representation of the query which indicates that the count operator is to be performed based on the second expression.
2 Assignments
0 Petitions
Accused Products
Abstract
A method for optimizing queries is described. A query, which includes a first expression for determining whether each of a set of values evaluates to NULL or NOT NULL, is received. At compile-time, a first representation of the query is generated, where the first representation indicates that the query is to be performed based on the first expression. Based on the first expression, a second expression is determined. The second expression is such that the first expression would evaluate to any NOT NULL value if and only if the second expression would evaluate to any NOT NULL value. The second expression, when evaluated, is much more computationally efficient compared with the evaluation of the first expression. Based on the first representation, a second representation of the query is generated, where the second representation indicates that the query is to be performed based on the second expression. Thereafter, the query is executed based on the second representation.
-
Citations
30 Claims
-
1. A method for processing queries comprising performing a machine-executed operation involving instructions, wherein the machine-executed operation is at least one of:
-
A) sending the instructions over transmission media; B) receiving the instructions over transmission media; C) storing the instructions onto a machine-readable storage medium; and D) executing the instructions; wherein the instructions are instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of; receiving a query that specifies a target set of data, wherein the query includes a count operator that is to be performed over a first set of values; wherein the count operator specifies a first expression which, when evaluated over the target set of data, would generate the first set of values; generating a first representation of the query, wherein the first representation indicates that the count operator is to be performed based on the first expression; determining a second expression based at least on the first expression, wherein the second expression is such that the first expression would evaluate to any NOT NULL value if and only if the second expression would evaluate to any NOT NULL value; and based on the first representation, generating a second representation of the query which indicates that the count operator is to be performed based on the second expression. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A method for processing queries comprising performing a machine-executed operation involving instructions, wherein the machine-executed operation is at least one of:
-
A) sending the instructions over transmission media; B) receiving the instructions over transmission media; C) storing the instructions onto a machine-readable storage medium; and D) executing the instructions; wherein the instructions are instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of; generating a first representation of a count( ) query, wherein the count( ) query includes a count operator to be performed based on a set of instances of XML data; wherein the count operator specifies an XPath expression which indicates the location of the set of instances of XML data in one or more target XML documents; and based on the XPath expression, rewriting the first representation into a second representation that corresponds to an equivalent query of the count( ) query, wherein the second representation indicates that the count operator is to be performed based on a set of rows stored in one or more relational tables, and wherein the second representation includes at least one operator which, when evaluated, identifies the set of rows in the one or more relational tables. - View Dependent Claims (20, 21, 22)
-
-
23. A method for processing queries comprising performing a machine-executed operation involving instructions, wherein the machine-executed operation is at least one of:
-
A) sending the instructions over transmission media; B) receiving the instructions over transmission media; C) storing the instructions onto a machine-readable storage medium; and D) executing the instructions; wherein the instructions are instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of; generating a first representation of a query, wherein the query includes a first expression for determining whether each of a set of values evaluates to any one of a NULL value and a NOT NULL value; determining a second expression based at least on the first expression, wherein the second expression is such that the first expression would evaluate to any NOT NULL value if and only if the second expression would evaluate to any NOT NULL value; and based on the first representation, generating a second representation of the query which indicates that the query is to be performed based on the second expression. - View Dependent Claims (24, 25, 26, 27, 28, 29, 30)
-
Specification