Portable and Iterative Re-Usable Suboptimization of Database Queries
First Claim
1. A method for optimizing a database query, the method comprising:
- generating a query plan for the database query, wherein the query plan includes first and second subplans;
retrieving cached optimization data associated with the first subplan and generated during evaluation of another query plan for a previous query that uses the first subplan;
evaluating the first subplan for resource cost using the retrieved optimization data;
evaluating the second subplan for resource cost; and
evaluating the query plan for resource cost based upon the evaluations of resource cost for the first and second subplans.
1 Assignment
0 Petitions
Accused Products
Abstract
A method, apparatus and program product to optimize a database query. A query plan is generated for the database query where the query plan includes first and second subplans. Cached optimization data associated with the first subplan and generated during evaluation of another query plan for a previous query that uses the first subplan is retrieved. The first subplan is evaluated for resource cost using the retrieved optimization data. The second subplan is also evaluated for resource cost. The query plan is then evaluated for resource cost based upon the evaluations of resource cost for the first and second subplans. A query plan is selected based on evaluations of resource cost and the plan is executed to generate a result set.
-
Citations
25 Claims
-
1. A method for optimizing a database query, the method comprising:
-
generating a query plan for the database query, wherein the query plan includes first and second subplans; retrieving cached optimization data associated with the first subplan and generated during evaluation of another query plan for a previous query that uses the first subplan; evaluating the first subplan for resource cost using the retrieved optimization data; evaluating the second subplan for resource cost; and evaluating the query plan for resource cost based upon the evaluations of resource cost for the first and second subplans. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
-
-
17. An apparatus comprising:
-
a processor; and program code configured to be executed by the processor to optimize a database query, the program code configured to generate a query plan for the database query wherein the query plan includes first and second subplans, retrieve cached optimization data associated with the first subplan and generated during evaluation of another query plan for a previous query that uses the first subplan, evaluate the first subplan for resource cost using the retrieved optimization data, evaluate the second subplan for resource cost, and evaluate the query plan for resource cost based upon the evaluations of resource cost for the first and second subplans. - View Dependent Claims (18, 19, 20, 21, 22, 23, 24)
-
-
25. A program product, comprising:
-
a computer readable medium; and a program code configured to optimize a database query, the program code further configured to generate a query plan for the database query wherein the query plan includes first and second subplans, retrieve cached optimization data associated with the first subplan and generated during evaluation of another query plan for a previous query that uses the first subplan, evaluate the first subplan for resource cost using the retrieved optimization data, evaluate the second subplan for resource cost, and evaluate the query plan for resource cost based upon the evaluations of resource cost for the first and second subplans.
-
Specification