WHERE C1 IN (SELECT MIN(c1) FROM T)
WHERE C1 = (SELECT MIN(c1) FROM T)
This transformation is considered before subquery materialization. If the transformation is performed, the subquery becomes materializable. In the example, if the IN subquery were not transformed, it would be evaluated anew for each row.
The subquery type transformation is shown in the following table.
Before Transformation | After Transformation |
---|---|
c1 IN (SELECT ...) | c1 = (SELECT ...) |
c1 = ANY (SELECT ...) | c1 = (SELECT ...) |
c1 <> ANY (SELECT ...) | c1 <> (SELECT ...) |
c1 > ANY (SELECT ...) | c1 > (SELECT ...) |
c1 >= ANY (SELECT ...) | c1 >= (SELECT ...) |
c1 < ANY (SELECT ...) | c1 < (SELECT ...) |
c1 <= ANY (SELECT ...) | c1 <= (SELECT ...) |