15. A non-transitory machine-readable storage medium carrying one or more sequence of instructions which, when executed by one or more processors, causes the one or more processor to perform: receiving a particular query that includes a particular operator, wherein the particular operator is one of MINUS and INTERSECT; generating a plurality of transformed queries, wherein each query of said plurality of transformed queries is generated by rewriting the particular query using a different combination of one or more transformations, and wherein each query of said plurality of transformed queries, if executed, produces a same result as said particular query but does not include said particular operator; wherein each of the transformed queries comprises a different sequence of operators, and wherein at least one of the operators in each of the different sequences of operators eliminates duplicate values; generating cost estimates for the transformed queries in said plurality of transformed queries; comparing the cost estimate for one of the transformed queries to the cost estimate for another of the transformed queries; and selecting from said plurality of transformed queries a particular transformed query to execute based, at least in part, on the cost estimates.
22. The machine-readable storage medium of claim 15 , wherein: the particular operator is the INTERSECT operator; the particular query specifies a left-hand source and a right-hand source for said INTERSECT operator; and the plurality of transformed queries includes a transformed query that is associated with an execution plan in which duplicate elimination is performed on both the left-hand source and the right-hand source prior to an equijoin between the left-hand source and the right-hand source.