Patent ID: 7353219

Claim:
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; d. executing a database query based on said selected query plan in step c, 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 said robustness measure being determined by a sensitivity of said first query plan to inaccurate input cardinality values estimated by said database query execution cost model, and said sensitivity being based on a validity range of said input row, outer cardinality for each operator in said first query plan, said first query plan being least-cost with respect to each of said at least one structurally equivalent query plans if values for said input row, outer cardinality are within said validity range, said first query plan not being least-cost, otherwise.