Patent ID: 7275051

Claim:
A method of processing a query in a database management system, the method comprising: (a) generating a preferred access path for a query with at least one variable at execution time, wherein said preferred access path is generated based upon a first value for each variable in the query produced and received during the execution time; (b) storing information related to said query, said first value for each variable and said preferred access path, wherein step (b) further includes: (b.1) determining a unique indicator unambiguously denoting a category of values that cause the generation of the same access path and choosing a category, wherein said category is at least one of: a category of values causing a table-space scan access path, a category of values causing an index-scan access path, a category of values causing an index-access access path, and a category corresponding to a cardinality range of said first value; (c) determining whether to regenerate said preferred access path for use with subsequent execution of the same query using a second value for each variable in that query produced and received during said subsequent execution, wherein said determination is based upon a comparison of the stored information related to said first value for each variable received during said execution time with information related to said second value for each variable received during said subsequent execution; and (d) regenerating said preferred access path for said query in response to said comparison indicating that said information related to said second value received during said subsequent execution differs sufficiently from said stored information related to said first value received during said execution time to enable generation of an access path different than said preferred access path.