Self-adjusting database-query optimizer
First Claim
Patent Images
1. A computer-implemented method for use in executing a query in a database system, the method comprising:
- formulating an initial query-execution plan that identifies an expected path for execution of the query;
formulating, prior to an execution of said query according to said initial query-execution plan, an alternative query-execution plan for execution of the query, said alternative query-execution plan differing from the initial query-execution plan from a point that occurs after an intermediate checkpoint in the initial query-execution plan;
initiating the execution of the query according to said initial query-execution plan;
at said intermediate checkpoint in the initial query-execution plan;
concluding that an actual result obtained at the intermediate checkpoint in the initial query-execution plan does not match an expected result; and
in response, choosing said alternative query-execution plan for the execution of the query;
continuing the execution of the query according to said alternative query-execution plan from said point that occurs after said intermediate checkpoint; and
abandoning the execution of the query according to said initial query-execution plan from said point that occurs after said intermediate checkpoint.
2 Assignments
0 Petitions
Accused Products
Abstract
A database-management system (DBMS) initiates execution of an incoming database query according to an initial query-execution plan that identifies an expected path for execution. Then, at some point after execution of the query has begun, the DBMS concludes that execution has not proceeded along the expected path and, in response, chooses an alternative query-execution plan for continued execution of the query.
26 Citations
14 Claims
-
1. A computer-implemented method for use in executing a query in a database system, the method comprising:
-
formulating an initial query-execution plan that identifies an expected path for execution of the query; formulating, prior to an execution of said query according to said initial query-execution plan, an alternative query-execution plan for execution of the query, said alternative query-execution plan differing from the initial query-execution plan from a point that occurs after an intermediate checkpoint in the initial query-execution plan; initiating the execution of the query according to said initial query-execution plan; at said intermediate checkpoint in the initial query-execution plan; concluding that an actual result obtained at the intermediate checkpoint in the initial query-execution plan does not match an expected result; and in response, choosing said alternative query-execution plan for the execution of the query; continuing the execution of the query according to said alternative query-execution plan from said point that occurs after said intermediate checkpoint; and abandoning the execution of the query according to said initial query-execution plan from said point that occurs after said intermediate checkpoint. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A computer-implemented method for use in executing a query in a database system, the method comprising:
-
formulating an initial query-execution plan that identifies an expected path for execution of the query; formulating, prior to an execution of said query according to said initial query-execution plan, an alternative query-execution plan for execution of the query; initiating the execution of the query according to said initial query-execution plan; and at some point after the execution of the query has begun; concluding that an actual result obtained at a first intermediate checkpoint in the initial query-execution plan matches an expected result for the first intermediate checkpoint; concluding that an actual result for a second intermediate checkpoint in the initial query-execution plan does not match an expected result for the second intermediate checkpoint; and in response, choosing said alternative query-execution plan for the execution of the query; continuing the execution of the query according to said alternative query-execution plan from a point that occurs after said second intermediate checkpoint; and abandoning the execution of the query according to said initial query-execution plan from said point that occurs after said second intermediate checkpoint.
-
-
8. A tangible, non-transitory computer readable storage medium, having a computer program for use in executing a query in a database system, the program comprising computer-readable instructions that, when executed by a computer, cause the computer to:
-
formulate an initial query-execution plan that identifies an expected path for execution of the query; formulate, prior to an execution of said query according to said initial query-execution plan, an alternative query-execution plan for execution of the query, said alternative-execution plan differing from the initial query-execution plan from a point that occurs after an intermediate checkpoint in the initial query-execution plan; initiate the execution of the query according to said initial query-execution plan; at said intermediate checkpoint in the initial query-execution plan; conclude that an actual result obtained at the intermediate checkpoint in the initial query-execution plan does not match an expected result; and in response, choose said alternative query-execution plan for the execution of the query; continue the execution of the query according to said alternative query-execution plan from said point that occurs after said intermediate checkpoint; and abandon the execution of the query according to said initial query-execution plan from said point that occurs after said intermediate checkpoint. - View Dependent Claims (9, 10, 11, 12, 13)
-
-
14. A tangible, non-transitory computer readable storage medium, having a computer program for use in executing a query in a database system, the computer program including computer-readable instructions that, when executed by a computer, cause the computer to:
-
formulate an initial query-execution plan for execution of the query that includes an initial cost estimate indicating how one or more database resources are expected to be used in carrying out the initial query-execution plan; formulate, prior to an execution of said query according to said initial query-execution plan, an alternative query-execution plan for execution of the query, said alternative-execution plan differing from the initial query-execution plan from a point that occurs after an intermediate checkpoint in the initial query-execution plan; start the execution of the query according to the initial query-execution plan; and at said intermediate checkpoint after the execution of the query according to the initial query-execution plan has started; receive information about an actual result obtained during the execution of the query according to the initial query-execution plan; use the actual result to calculate a revised cost estimate indicating how the one or more database resources are expected to be used in carrying out the initial query-execution plan from the intermediate checkpoint; compare the revised cost estimate to the initial cost estimate; conclude that the revised cost estimate lies beyond a predetermined margin-of-error around the initial cost estimate; continue the execution of the query according to said alternative query-execution plan from said point that occurs after said intermediate checkpoint; and abandon the execution of the query according to said initial query-execution plan from said point that occurs after said intermediate checkpoint.
-
Specification