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.
18. 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 set operator comprises a condition that is satisfied for a set of values if the condition is satisfied individually by any values of the set, wherein the condition applies differently to null values than to non-null values; based at least in part on determining that the particular set operator comprises the condition, eliminating the particular subquery and the particular set operator, and generating the added predicate such that the added predicate applies differently to null values than to non-null values.