Identifying high risk database statements in changing database environments
First Claim
1. A computer-executed method comprising:
- based, at least in part, on a first set of statistics comprising a first hypothetical value for a particular attribute of particular data in a database, said particular attribute specifying how much data is hypothetically stored in one or more particular tables or indexes in the database, identifying a first execution plan that a database management system generates for particular database statements that run over the particular data;
after identifying the first execution plan, and based, at least in part, on a second set of statistics comprising a second hypothetical value, for the particular attribute of the particular data, identifying a second execution plan that the database management system generates for the particular database statements;
wherein the first hypothetical value is different than the second hypothetical value;
in response to detecting that the second execution plan is different than the first execution plan, automatically tuning the particular database statements;
wherein the method is performed by one or more computing devices.
1 Assignment
0 Petitions
Accused Products
Abstract
High-risk database statements are identified. A DBMS performs a series of experiments by generating sets of statistics describing data over which particular database statements run. The DBMS submits each of these sets of statistics to a query optimizer, which returns information for an execution plan that the optimizer would use to implement the statements given the submitted set of data statistics. If the DBMS determines that the optimizer changes the established execution plan for the database statements for any of the submitted sets of statistics, the DBMS performs one or more actions to mitigate the risk of changing execution plans, such as automatically tuning the database statements or the entire workload, and/or sending information about the database statements to a database administrator. Techniques are also described for calculating diagnostic values based on the results of such experiments, which quantify the sensitivity of the execution plans to changes in data statistics.
218 Citations
16 Claims
-
1. A computer-executed method comprising:
-
based, at least in part, on a first set of statistics comprising a first hypothetical value for a particular attribute of particular data in a database, said particular attribute specifying how much data is hypothetically stored in one or more particular tables or indexes in the database, identifying a first execution plan that a database management system generates for particular database statements that run over the particular data; after identifying the first execution plan, and based, at least in part, on a second set of statistics comprising a second hypothetical value, for the particular attribute of the particular data, identifying a second execution plan that the database management system generates for the particular database statements; wherein the first hypothetical value is different than the second hypothetical value; in response to detecting that the second execution plan is different than the first execution plan, automatically tuning the particular database statements; wherein the method is performed by one or more computing devices. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer-executed method comprising:
-
generating a plurality of execution plans for particular database statements; wherein the plurality of execution plans are based on a plurality of sets of statistics that characterize particular data, stored in a database, over which the particular database statements are configured to run; wherein the plurality of execution plans includes, for each set of statistics in the plurality of sets of statistics, an execution plan that is based on the set of statistics; wherein a first set of statistics of the plurality of sets of statistics comprises a first hypothetical value for a particular attribute; wherein a second set of statistics of the plurality of sets of statistics comprises a second hypothetical value for the particular attribute; wherein the first hypothetical value and the second hypothetical value are different; generating a diagnostic value for the particular database statements based, at least in part, on; a change between (a) the first hypothetical value for the particular attribute and (b) the second hypothetical value for the particular attribute, and a change between (a) a cost of a first execution plan, of the plurality of execution plans, that is generated based on the first set of statistics and (b) a cost of a second execution plan, of the plurality of execution plans, that is generated based on the second set of statistics; and in response to determining that the diagnostic value exceeds a particular threshold, performing one or more of a set of actions comprising; automatically tuning the particular database statements, and including information for the particular database statements in a report set of information; wherein the method is performed by one or more computing devices. - View Dependent Claims (7, 8)
-
-
9. One or more non-transitory computer-readable media storing one or more sequences of instructions which, when executed by one or more processors, cause:
-
based, at least in part, on a first set of statistics comprising a first hypothetical value for a particular attribute of particular data in a database, said particular attribute specifying how much data is hypothetically stored in one or more particular tables or indexes in the database, identifying a first execution plan that a database management system generates for particular database statements that run over the particular data; after identifying the first execution plan, and based, at least in part, on a second set of statistics comprising a second hypothetical value, for the particular attribute of the particular data, identifying a second execution plan that the database management system generates for the particular database statements; wherein the first hypothetical value is different than the second hypothetical value; in response to detecting that the second execution plan is different than the first execution plan, automatically tuning the particular database statements. - View Dependent Claims (10, 11, 12, 13)
-
-
14. One or more non-transitory computer-readable media storing one or more sequences of instructions which, when executed by one or more processors, cause:
-
generating a plurality of execution plans for particular database statements; wherein the plurality of execution plans are based on a plurality of sets of statistics that characterize particular data, stored in a database, over which the particular database statements are configured to run; wherein the plurality of execution plans includes, for each set of statistics in the plurality of sets of statistics, an execution plan that is based on the set of statistics; wherein a first set of statistics of the plurality of sets of statistics comprises a first hypothetical value for a particular attribute; wherein a second set of statistics of the plurality of sets of statistics comprises a second hypothetical value for the particular attribute; wherein the first hypothetical value and the second hypothetical value are different; generating a diagnostic value for the particular database statements based, at least in part, on; a change between (a) the first hypothetical value for the particular attribute and (b) the second hypothetical value for the particular attribute, and a change between (a) a cost of a first execution plan, of the plurality of execution plans, that is generated based on the first set of statistics and (b) a cost of a second execution plan, of the plurality of execution plans, that is generated based on the second set of statistics; and in response to determining that the diagnostic value exceeds a particular threshold, performing one or more of a set of actions comprising; automatically tuning the particular database statements, and including information for the particular database statements in a report set of information. - View Dependent Claims (15, 16)
-
Specification