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.