Patent Document ID: 8874547
Application ID: 12651634

Base Claim:
1. A method, comprising: receiving a first query configured according to a query template, the first query including values for a plurality of parameters of the query template, the first query comprising a plurality of efficiency expressions; managing a plurality of query plans using a selectivity space by: defining the selectivity space as an array of selectivity regions arranged according to a grid that has a number of dimensions equal to a number of efficiency expressions of the first query, the grid, in accordance with the plurality of efficiency expressions, comprising a multi-dimensional logarithmic-scale grid divided into a plurality of multi-dimensional regions forming the array of selectivity regions, compiling, the first query to generate a first query plan, determining a first selectivity region in the selectivity space for the first query, generating a first key for the first query that includes an indication of the first selectivity region, and storing, by a computer system, the first query plan in association with the first key; and executing, by the computer system, the first query plan with respect to the first query.

---

Claim 2:
2. The method of claim 1 , further comprising: determining, by the computer system, a plan variant for an equality efficiency expression of the query template prior to receiving the first query, the plan variant including a corresponding key and query plan; and storing, by the computer system, the plan variant.