1. A method of processing a query, comprising: determining which particular candidate identification technique, of two or more candidate identification techniques available to a query-processing unit, to use to process the query; wherein each candidate identification technique is a technique for identifying which semantically equivalent queries, of all possible semantically equivalent queries, will belong to a particular set of candidate queries; determining an initial set of candidate queries for the query based on the particular candidate identification technique; determining costs for one or more particular queries of the initial set of candidate queries; choosing a particular query, from a set of candidate queries, based on costs for each query in the set of candidate queries, wherein the set of candidate queries includes the one or more particular queries; and responding to a request to execute the query by executing the particular query.