Determining validity ranges of query plans based on suboptimality
First Claim
1. A method for selecting an optimal query plan for the execution of a database query, said method comprising:
- a. comparing a first query plan chosen by a query optimizer to at least one structurally equivalent query plan, said comparison made with respect to cost as a function of input row, outer cardinality;
b. developing a robustness measure for each of said first query plan and at least one structurally equivalent query plan, said robustness measured by the probability that each of said first query plan and at least one structurally equivalent query plans is least-cost with respect to cost determined by a database query execution cost model;
c. selectively choosing either of;
said first query plan or one of said at least one structurally equivalent query plans, based on a comparison of said developed robustness measures and, wherein said developed robustness measure for said chosen query plan is greater in value than each of said developed robustness measures for each of said first query plan and at least one structurally equivalent query plans not chosen in said choosing step.
1 Assignment
0 Petitions
Accused Products
Abstract
“Determining Validity Ranges of Query Plans Based on Suboptimality” A method for approximating a validity range for a domain of cardinalities of input to an optimal query plan is provided. Such a validity range is iteratively approximated using a modified Newton-Raphson method to find roots of cost functions for optimal and alternative query plans, respectively. The Newton-Raphson method is combined with a method of incrementing roots of cost functions, known as input cardinalities, such that discontinuous and non-differentiable points in cost functions are avoided. In this manner, input cardinalities remain within a domain for which a valid range can be specified. Additionally, a robustness measure is determined by a sensitivity analysis performed on an approximated validity range. Using a robustness measure provided by a sensitivity analysis and resultant validity range and, query plan sub-optimality detection is simplified, re-optimization is selectively triggered, and robustness information is provided to a system or user performing corrective actions.
69 Citations
28 Claims
-
1. A method for selecting an optimal query plan for the execution of a database query, said method comprising:
-
a. comparing a first query plan chosen by a query optimizer to at least one structurally equivalent query plan, said comparison made with respect to cost as a function of input row, outer cardinality;
b. developing a robustness measure for each of said first query plan and at least one structurally equivalent query plan, said robustness measured by the probability that each of said first query plan and at least one structurally equivalent query plans is least-cost with respect to cost determined by a database query execution cost model;
c. selectively choosing either of;
said first query plan or one of said at least one structurally equivalent query plans, based on a comparison of said developed robustness measures and,wherein said developed robustness measure for said chosen query plan is greater in value than each of said developed robustness measures for each of said first query plan and at least one structurally equivalent query plans not chosen in said choosing step. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A method for determining the sensitivity of a first query plan chosen by a database query optimizer to input row cardinality values inaccurately estimated by a database query execution cost model, said method comprising:
-
a. comparing said first query plan to at least one structurally equivalent query plan;
said comparison made with respect to cost as a function over a range of input row cardinality values;
b. developing a validity range of said input row cardinalities values for each operator in said first query plan based on results of said comparison such that said first query plan is least-cost within said developed validity range and said first query plan is not least-cost outside of said developed validity range; and
wherein said sensitivity is proportional to size of said developed validity range. - View Dependent Claims (7, 8, 9)
-
-
10. A method for iteratively refining the sensitivity of a first query plan to inaccurate input cardinality values estimated by a database query execution cost model, said sensitivity iteratively refined from an initial approximation of a validity range for bounding the cardinality of at least one input to a first query plan, said first query plan being least-cost for cardinalities of inputs within said range, each of said iterations comprising:
-
a. computing a first difference between costs, a first cost determined by a cost function for said first query plan and a second cost determined by a cost function for said second, alternative query plan, each of said costs determined as a function of a common input cardinality, each of said cost functions determined by a database query execution cost model;
b. incrementing said common input cardinality;
c. computing a second difference between costs of said first and second query plans, each of said costs determined as a function of said incremented input cardinality;
d. comparing said first and second differences to determine either of;
convergence or divergence between said first and second cost functions,e. estimating a cost resulting from a cost function determined by said first and second differences, said cost function receiving as input, said incremented cardinality estimate based on said comparison; and
f. adjusting said bounds of said validity range based on said estimated cost, wherein said sensitivity is proportional to said adjusted bounds. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A method for optimally processing data with a processing plan, said method comprising:
-
a. analyzing the sensitivity of operators in said processing plan to a range of input parameter values, said sensitivity analysis determining a robustness measure for said processing plan;
b. detecting sub-optimality of said processing plan when at least one input parameter value is outside of said range of input parameter values, based on said robustness measure;
c. selectively triggering corrective action based on said sub-optimality detection, wherein said corrective action enables continuity in optimality of said processing of data. - View Dependent Claims (20, 21, 22)
-
-
23. A article of manufacture comprising computer usable medium having computer readable program code embodied therein which selects an optimal query plan for the execution of a database query, said medium comprising computer readable program code for:
-
a. comparing a first query plan chosen by a query optimizer to at least one structurally equivalent query plan, said comparison made with respect to cost as a function of input row, outer cardinality;
b. developing a robustness measure for each of said first query plan and at least one structurally equivalent query plans, said robustness measured by the probability that each of said first query plan and at least one structurally equivalent query plans is least-cost with respect to cost determined by a database query execution cost model; and
c. choosing either of;
said first query plan or one of said at least one structurally equivalent query plans, based on a comparison of said developed robustness measures,wherein said developed robustness measure for said chosen query plan is greater in value than each of said developed robustness measures for each of said first query plan and at least one structurally equivalent query plans not chosen in said choosing step.
-
-
24. A article of manufacture comprising computer usable medium having computer readable program code embodied therein which, iteratively refines the sensitivity of a first query plan to inaccurate input cardinality values estimated by a database query execution cost model, said sensitivity iteratively refined from an initial approximation of a validity range for bounding the cardinality of at least one input to a first query plan, said first query plan being least-cost for cardinalities of inputs within said range, said medium comprising computer readable program code for:
-
a. computing a first difference between costs, a first cost determined by a cost function for said first query plan and a second cost determined by a cost function for said second, alternative query plan, each of said costs determined as a function of a common input cardinality, each of said cost functions determined by a database query execution cost model;
b. incrementing said common input cardinality;
c. computing a second difference between costs of said first and second query plans, each of said costs determined as a function of said incremented input cardinality;
d. comparing said first and second differences to determine either of;
convergence or divergence between said first and second cost functions;
e. estimating a cost resulting from a cost function determined by said first and second differences, said cost function receiving as input, said incremented cardinality estimate based on said comparison; and
f. adjusting said bounds of said validity range based on said estimated cost, wherein said sensitivity is proportional to said adjusted bounds.
-
-
25. A article of manufacture comprising computer usable medium having computer readable program code embodied therein which optimally processes data using a processing plan, said medium comprising computer readable program code for:
-
a. analyzing the sensitivity of operators in said processing plan to a range of input parameter values, said sensitivity analysis determining a robustness measure for said processing plan;
b. detecting sub-optimality of said plan when at least one input parameter value is outside of said range of input parameter values, based on said robustness measure; and
c. selectively triggering corrective action based on said sub-optimality detection.
-
-
26. A method of deploying autonomic functionality in a database system as a business service, said method comprising:
-
a. analyzing the sensitivity of operators in a data processing plan for said database system to a range of input parameter values, said sensitivity analysis determining a robustness measure for said processing plan;
b. detecting sub-optimality of said plan when at least one input parameter value is outside of said range of input parameter values, based on said robustness measure; and
c. selectively triggering corrective action based on said sub-optimality detection, wherein said selective triggering of corrective action is a service enabled as an option by a user. - View Dependent Claims (27, 28)
-
Specification