Patent ID: 8352461

Claim:
One or more non-transitory computer-readable storage media storing instructions which, when executed by one or more processors, cause: generating a transformed query based on a particular query that includes a join operation between a left table and a right table in response to determining that: the particular query includes a predicate that returns rows from the left table based on a join predicate, the join predicate specifies an equality between a joining column of the left table and a joining column of the right table, the joining column of the left table has a referential integrity constraint on the joining column of the right table, and no column of the right table is referenced in the particular query except in the join predicate of the particular query; wherein said join operation is one of a semi-join operation or an anti-join operation; wherein generating the transformed query includes the steps of: if said join operation is a semi-join operation, then excluding the right table and the join predicate from the transformed query and including, in the transformed query, the left table and a transformed predicate that specifies that the joining column of the left table is not null, or if said join operation is an anti-join operation, then excluding the right table and the join predicate from the transformed query and including, in the transformed query, the left table and (a) a transformed predicate that specifies that the joining column of the left table is null or (b) a transformed predicate that is a false condition.