1. A computer-readable storage medium storing one or more sequences of instructions which, when executed by one or more processors, causes the one or more processors to perform steps of: generating a transformed query based on a particular query, wherein said particular query includes: an outer query; a view within a FROM list of the outer query; a join predicate in the WHERE clause of the outer query that references: an outer table column of an outer table of the outer query, and a returned column that is returned by the view and that is equivalent to an equivalent column in the SELECT clause of the view; wherein said view includes: a GROUP BY operator that references said equivalent column, or a DISTINCT operator that references said equivalent column; and wherein generating the transformed query includes pushing down the join predicate into said view, wherein pushing down the join predicate includes (1) removing the join predicate from the outer query and (2) creating, within said view, a new join predicate that references the outer table column of the outer table and said equivalent column.