4. The method of claim 1 , further comprising: receiving, by the computer system, a second query configured according to the query template, the second query including values for the plurality of parameters; determining, by the computer system, a second selectivity region in the selectivity space for the second query; generating, by the computer system, a second key for the second query that includes the second selectivity region; determining whether the second key matches any stored key including the first key; and executing, by the computer system, the first query plan with respect to the second query if the second key is determined to match the first key.
5. The method of claim 4 , further comprising: if the second key is determined to not match any stored key, compiling, by the computer system, the second query to generate a second query plan, and executing, by the computer system, the second query plan with respect to the second query.