Optimizing database queries using query execution plans derived from automatic summary table determining cost based queries
First Claim
1. A method of optimizing a query in a computer, the query being performed by the computer to retrieve data from a database stored on the computer, the method comprising the steps of:
- (a) identifying one or more automatic summary tables (ASTs) that overlap the query by matching definitions of the ASTs with requirements of the query, wherein the requirements of the query satisfied by an AST are encapsulated as a set of properties;
(b) enumerating one or more alternative query execution plans (QEPs) for the query, including at least one QEP that represents one or more access paths of the identified ASTs;
(c) assigning a cost to each of the alternative QEPs; and
(d) choosing a most efficient one of the alternative QEPs based upon the assigned costs.
3 Assignments
0 Petitions
Accused Products
Abstract
A method, apparatus, and article of manufacture for optimizing database queries using automatic summary tables. Query execution plans derived from an automatic summary table can be used to generate results for the query if a comparison of the query requirements with an automatic summary table definition determines that the automatic summary table overlaps the query, and if an optimization process determines that using the summary table will lower the cost of the query. The optimization process involves enumerating a plurality of query execution plans for the query, wherein the query execution plans enumerated include those that access combinations of query and summary tables. Each such query execution plan is assigned a cost representing an estimation of its execution characteristics, and the least costly query execution plan is selected for the query.
-
Citations
57 Claims
-
1. A method of optimizing a query in a computer, the query being performed by the computer to retrieve data from a database stored on the computer, the method comprising the steps of:
-
(a) identifying one or more automatic summary tables (ASTs) that overlap the query by matching definitions of the ASTs with requirements of the query, wherein the requirements of the query satisfied by an AST are encapsulated as a set of properties;
(b) enumerating one or more alternative query execution plans (QEPs) for the query, including at least one QEP that represents one or more access paths of the identified ASTs;
(c) assigning a cost to each of the alternative QEPs; and
(d) choosing a most efficient one of the alternative QEPs based upon the assigned costs. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
-
-
18. A computer-implemented apparatus for optimizing a query, wherein the query is performed by the computer to retrieve data from a database stored on the computer, the apparatus comprising:
-
(a) a computer;
(b) logic, performed by the computer, for;
(1) identifying one or more automatic summary tables (ASTs) that overlap the query by matching definitions of the ASTs with requirements of the query, wherein the requirements of the query satisfied by an AST are encapsulated as a set of properties;
(2) enumerating one or more alternative query execution plans (QEPs) for the query, including at least one QEP that represents one or more access paths of the identified ASTs;
(3) assigning a cost to each of the alternative QEPs; and
(4) choosing a most efficient one of the alternative QEPs based upon the assigned costs. - View Dependent Claims (19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34)
-
-
35. An article of manufacture embodying logic for performing method steps 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:
-
(a) identifying one or more automatic summary tables (ASTs) that the query by matching definitions of the ASTs with requirements of the query, wherein the requirements of the query satisfied by an AST are encapsulated as a set of properties;
(b) enumerating one or more alternative query execution plans (QEPS) for the query, including at least one QEP that represents one or more access of the identified ASTs;
(c) assigning a cost to each of the alternative QEPs; and
(d) choosing a most efficient one of the alternative QEPs based upon the assigned costs. - View Dependent Claims (36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57)
-
Specification