×

Determining validity ranges of query plans based on suboptimality

  • US 8,812,486 B2
  • Filed: 02/08/2008
  • Issued: 08/19/2014
  • Est. Priority Date: 05/28/2004
  • Status: Expired due to Fees
First Claim
Patent Images

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, said first query plan formulated based on a graph of query plan operators connected by directed edges, with each edge d providing a set of rows to an operator o in a given query plan;

    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, and said robustness measure for a query operator and a query plan being proportional to a size of a corresponding validity range, with a larger validity range for a query operator or plan indicating a proportionally larger margin of allowable error in cardinality estimation prior to a query plan being deemed sub-optimal, said validity range for each said edge d defined by an upper and lower bound on a cardinality of rows flowing through operator o, such that when said cardinality of rows flowing through operator o falls outside said upper and lower bounds, a given plan becomes sub-optimal;

    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.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×