SQL EXECUTION PLAN VERIFICATION
First Claim
1. A system comprising:
- a query optimizer configured to generate query plans for executing database commands;
a repository configured to store verification data that identifies a first set of the query plans as having been designated as acceptable for executing database commands, and a second set of the query plans as awaiting verification;
wherein the query optimizer is further configured to select particular query plans, of the query plans generated by the query optimizer, to execute particular database commands, based at least in part on whether the verification data indicates that the particular query plans are within the first set;
a database server configured to execute particular query plans selected by the query optimizer;
a verification component configured to;
perform comparisons of first performance statistics collected during execution of first query plans in the first set of the query plans to second performance statistics collected during execution of second query plans in the second set of the query plans, and update the verification data to move one or more of the second query plans from the second set to the first set based on the comparisons.
0 Assignments
0 Petitions
Accused Products
Abstract
Approaches, techniques, and mechanisms are disclosed for ensuring that a database command is executed according to a query plan that has been verified to be actually optimal. Except in rare circumstances, a database server does not execute a query plan unless it is first verified by the database server. The database server receives a request to execute a database command. The database server determines an unverified plan is the best plan for satisfying the request. Rather than risk the unknown behavior of an unverified plan, the database server instead satisfies the request according to a verified plan. Subsequently—for example as part of a scheduled job—the database server executes the unverified plan to determine performance statistics. Based at least on the performance statistics, the database server determines whether or not to verify the unverified plan. Techniques for concurrent and optimistic verifications are also disclosed.
-
Citations
24 Claims
-
1. A system comprising:
-
a query optimizer configured to generate query plans for executing database commands; a repository configured to store verification data that identifies a first set of the query plans as having been designated as acceptable for executing database commands, and a second set of the query plans as awaiting verification; wherein the query optimizer is further configured to select particular query plans, of the query plans generated by the query optimizer, to execute particular database commands, based at least in part on whether the verification data indicates that the particular query plans are within the first set; a database server configured to execute particular query plans selected by the query optimizer; a verification component configured to;
perform comparisons of first performance statistics collected during execution of first query plans in the first set of the query plans to second performance statistics collected during execution of second query plans in the second set of the query plans, and update the verification data to move one or more of the second query plans from the second set to the first set based on the comparisons. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A method comprising:
-
generating query plans for executing database commands; storing verification data that identifies a first set of the query plans as having been designated as acceptable for executing database commands, and a second set of the query plans as awaiting verification; selecting particular query plans, of the query plans generated by the query optimizer, to execute particular database commands, based at least in part on whether the verification data indicates that the particular query plans are within the first set; executing at least first query plans in the first set of the query plans and second query plans in the second set of the query plans; performing comparisons of first performance statistics collected during execution of the first query plans in the first set of the query plans to second performance statistics collected during execution of the second query plans in the second set of the query plans; updating the verification data to move one or more of the second query plans from the second set to the first set based on the comparisons. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. One or more non-transitory computer-readable media, storing instructions that, when executed by one or more computing devices, cause performance of:
-
generating query plans for executing database commands; storing verification data that identifies a first set of the query plans as having been designated as acceptable for executing database commands, and a second set of the query plans as awaiting verification; selecting particular query plans, of the query plans generated by the query optimizer, to execute particular database commands, based at least in part on whether the verification data indicates that the particular query plans are within the first set; executing at least first query plans in the first set of the query plans and second query plans in the second set of the query plans; performing comparisons of first performance statistics collected during execution of the first query plans in the first set of the query plans to second performance statistics collected during execution of the second query plans in the second set of the query plans; updating the verification data to move one or more of the second query plans from the second set to the first set based on the comparisons. - View Dependent Claims (18, 19, 20, 21, 22, 23, 24)
-
Specification