Matching and compensation tests for optimizing correlated subqueries within query using automatic summary tables
First Claim
Patent Images
1. A method of optimizing a query in a computer system, the query being performed by the computer system to retrieve data from a database stored on the computer system, the method comprising the steps of:
- (a) generating an automatic summary table for use in optimizing the query;
(b) analyzing the query using matching and compensation tests between the query, at least one correlated subquery within the query and the automatic summary table to determine whether there is a match between the query, the correlated subquery and the automatic summary table using a bottom-up traversal of boxes in query graph models (QGMs) for the query, correlated subquery and automatic summary table that tries to establish matches between the query, correlated subquery and automatic summary table, until it reaches a top of the QGM for the automatic summary table, so that expressions occurring in the query including the correlated subquery, but not in the automatic summary table, can be derived using the automatic summary table; and
(c) rewriting the query so that the automatic summary table is used when there is a match, wherein the rewritten query is performed by the computer system to retrieve data from the database.
3 Assignments
0 Petitions
Accused Products
Abstract
A method, apparatus, and article of manufacture for optimizing database queries using an automatic summary table. A query is analyzed using matching and compensation tests between the query at least one correlated subquery within the query and the automatic summary table to determine whether expressions occurring in the query, but not in the automatic summary table, can be derived using the automatic summary table. If so, the query is rewritten so that the automatic summary table is used.
-
Citations
21 Claims
-
1. A method of optimizing a query in a computer system, the query being performed by the computer system to retrieve data from a database stored on the computer system, the method comprising the steps of:
-
(a) generating an automatic summary table for use in optimizing the query; (b) analyzing the query using matching and compensation tests between the query, at least one correlated subquery within the query and the automatic summary table to determine whether there is a match between the query, the correlated subquery and the automatic summary table using a bottom-up traversal of boxes in query graph models (QGMs) for the query, correlated subquery and automatic summary table that tries to establish matches between the query, correlated subquery and automatic summary table, until it reaches a top of the QGM for the automatic summary table, so that expressions occurring in the query including the correlated subquery, but not in the automatic summary table, can be derived using the automatic summary table; and (c) rewriting the query so that the automatic summary table is used when there is a match, wherein the rewritten query is performed by the computer system to retrieve data from the database. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer-implemented apparatus for optimizing a query, comprising:
-
(a) a computer system; (b) logic, performed by the computer system, for (1) generating an automatic summary table for use in optimizing the query; (2) analyzing the query using matching and compensation tests between the query, at least one correlated subquery within the query and the automatic summary table to determine whether there is a match between the query, the correlated subquery and the automatic summary table using a bottom-up traversal of boxes in query graph models (QGMs) for the query, correlated subquery and automatic summary table that tries to establish matches between the query, correlated subquery and automatic summary table, until it reaches a top of the QGM for the automatic summary table, so that expressions occurring in the query including the correlated subquery, but not in the automatic summary table, can be derived using the automatic summary table; and (3) rewriting the query so that the automatic summary table is used when there is a match, wherein the rewritten query is performed by the computer system to retrieve data from the database. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. An article of manufacture embodying logic for performing a method for optimizing a query, the query being performed by a computer system to retrieve data from a database stored in a data storage device coupled to the computer system, the method comprising the steps of:
-
(a) generating an automatic summary table for use in optimizing the query; (b) analyzing the query using matching and compensation tests between the query, at least one correlated subquery within the query and the automatic summary table to determine whether there is a match between the query, the correlated subquery and the automatic summary table, so that expressions occurring in the query including the correlated subquery, but not in the automatic summary table, can be derived using the automatic summary table using a bottom-up traversal of boxes in query graph models (QGMs) for the query, correlated subquery and automatic summary table that tries to establish matches between the query, correlated subquery and automatic summary table, until it reaches a top of the QGM for the automatic summary table; and (c) rewriting the query so that the automatic summary table is used when there is a match, wherein the rewritten query is performed by the computer system to retrieve data from the database. - View Dependent Claims (16, 17, 18, 19, 20, 21)
-
Specification