System and method for rewriting relational database queries
First Claim
Patent Images
1. A method for answering a database query, the method comprising:
- providing a database query;
determining if the query should be rewritten, including a substep of determining if a first precomputed view may be utilized to rewrite the query; and
rewriting the database query by utilizing a predefined hierarchy of data, the rewriting being performed if it is determined that the query should be rewritten;
wherein the precomputed view includes at least one predicate which is not included in the query, and wherein the substep of determining if the first precomputed view may be utilized to rewrite the query further includes a substep of determining whether it is acceptable to utilize the first precomputed view which includes the at least one predicate which is not included in the query.
5 Assignments
0 Petitions
Accused Products
Abstract
A system and method for answering a relational database query is presented. According to an embodiment of the present invention, a database query is received. It is then determined whether that query can be rewritten in such a manner as to be able to utilize a precomputed view, such that an answer to the rewritten query is equivalent to an answer to the original query. If the query can be rewritten, it is determined whether the rewritten query can more efficiently derive the answer than the original query. The query which has the most efficiently derived answer is the query which is utilized to derive that answer.
195 Citations
8 Claims
-
1. A method for answering a database query, the method comprising:
-
providing a database query;
determining if the query should be rewritten, including a substep of determining if a first precomputed view may be utilized to rewrite the query; and
rewriting the database query by utilizing a predefined hierarchy of data, the rewriting being performed if it is determined that the query should be rewritten;
wherein the precomputed view includes at least one predicate which is not included in the query, and wherein the substep of determining if the first precomputed view may be utilized to rewrite the query further includes a substep of determining whether it is acceptable to utilize the first precomputed view which includes the at least one predicate which is not included in the query.
-
-
2. A method for answering a database query, the method comprising:
-
providing a database query;
determining if the query should be rewritten, including a substep of determining if a first precomputed view may be utilized to rewrite the query; and
rewriting the database query by utilizing a predefined hierarchy of data, the rewriting being performed if it is determined that the query should be rewritten;
wherein the query includes at least one predicate which is not included in the first precomputed view, and wherein the substep of determining if the first precomputed view may be utilized to rewrite the query further includes a substep of determining whether it is acceptable to utilize the first precomputed view despite the query including the at least one predicate which is not included in the first precomputed view. - View Dependent Claims (3, 4)
-
-
5. A computer program product, tangibly stored on a computer-readable medium, for answering a database query, comprising instructions operable to cause a programmable processor to:
-
provide a database query;
determine if the query should be rewritten, including a substep of determining if a first precomputed view may be utilized to rewrite the query; and
rewrite the database query by utilizing a predefined hierarchy of data, the rewriting being performed if it is determined that the query should be rewritten;
wherein the precomputed view includes at least one predicate which is not included in the query, and wherein the substep of determining if the first precomputed view may be utilized to rewrite the query further includes a substep of determining whether it is acceptable to utilize the first precomputed view which includes the at least one predicate which is not included in the query.
-
-
6. A computer program product, tangibly stored on a computer-readable medium, for answering a database query, comprising instructions operable to cause a programmable processor to:
-
provide a database query;
determine if the query should be rewritten, including a substep of determining if a first precomputed view may be utilized to rewrite the query; and
rewrite the database query by utilizing a predefined hierarchy of data, the rewriting being performed if it is determined that the query should be rewritten;
wherein the query includes at least one predicate which is not included in the first precomputed view, and wherein the substep of determining if the first precomputed view may be utilized to rewrite the query further includes a substep of determining whether it is acceptable to utilize the first precomputed view despite the query including the at least one predicate which is not included in the first precomputed view. - View Dependent Claims (7, 8)
-
Specification