13. One or more non-transitory computer-readable storage media storing sequences of instructions that, when executed by one or more computing devices, cause: receiving a first query comprising an outer query that: includes one or more set operators; instantiates a particular data object using a first name; references a first instance of the particular data object using said first name; wherein at least a particular set operator of the one or more set operators includes a particular subquery that: instantiates the particular data object using a second name; references a second instance of the particular data object using said second name; based at least in part on the first query, transforming the first query to a second query that does not contain at least the particular subquery or the particular set operator; wherein the second query comprises an added predicate that is based at least in part on the particular subquery; wherein the added predicate references the first instance of the particular data object using said first name without referencing the second instance of the particular data object using said second name; and wherein the second query is semantically equivalent to the first query; generating an execution plan for executing the second query; causing execution of the second query instead of the first query based on the execution plan for executing the second query.
15. The one or more non-transitory computer-readable storage media of claim 13 , wherein the sequences of instructions include instructions that, when executed by said one or more computing devices, cause: determining that the particular subquery contains at least one filter predicate and at least one connecting or correlating predicate that define conditions; determining that all connecting or correlating predicates reference columns of the second instance that are collectively unique-valued; based at least in part on determining that all connecting or correlating predicates reference the columns of the second instance that are collectively unique-valued, eliminating the particular subquery and generating the added predicate to preserve the conditions defined by the at least one filter predicate and the at least one connecting or correlating predicate.