1. A computer-implemented method of processing a query, comprising: determining a set of candidate queries for the query based on a particular candidate identification technique; wherein the particular candidate identification technique identifies as candidate queries fewer than all semantically equivalent queries that are determinable from transformations of one or more query blocks in the query; determining costs for each candidate query of the set of candidate queries; choosing a particular query, from the set of candidate queries, based on costs for each query in the set of candidate queries; wherein each candidate query in the set of candidate queries is semantically equivalent to the query; and executing the particular query in response to a request to execute the query; wherein the method is performed by one or more computing devices.
1. A computer-implemented method of processing a query, comprising: determining a set of candidate queries for the query based on a particular candidate identification technique; wherein the particular candidate identification technique identifies as candidate queries fewer than all semantically equivalent queries that are determinable from transformations of one or more query blocks in the query; determining costs for each candidate query of the set of candidate queries; choosing a particular query, from the set of candidate queries, based on costs for each query in the set of candidate queries; wherein each candidate query in the set of candidate queries is semantically equivalent to the query; and executing the particular query in response to a request to execute the query; wherein the method is performed by one or more computing devices. 14. The method of claim 1 , further comprising: prior to determining the set of candidate queries for the query, determining the particular candidate identification technique from two or more candidate identification techniques that are available to a query-processing unit to process the query; wherein each candidate identification technique, of the two or more candidate identification techniques, is a technique for identifying which semantically equivalent queries belong to a particular set of candidate queries.