Patent ID: 8880511

Claim:
A system for optimizing database queries and estimating query costs, the system comprising: a computer-readable medium having a tree indexed data structure comprising nodes, the computer-readable medium operable to store a computer-readable query optimizer; and a processor operable to execute the query optimizer for computing a cost estimate ratio associated with performing a query based at least in part on a key value, the cost estimate ratio comprising a first number of nodes in the tree indexed data structure having values less than the key value versus a second number of nodes in the tree indexed data structure having values more than the key value, and further operable to compute a cost estimation by normalizing the cost estimate ratio relative to a total size of the tree indexed data structure, wherein the tree indexed data structure comprises a hierarchical structure with a root node and a plurality of child nodes, and further wherein the tree indexed data structure is traversed with the key value to compute the cost estimate ratio associated with performing the query based at least in part on the key value.