Greg Stark <gsstark@mit.edu> writes:
> ... And you can use UNION ALL instead of UNION
> since the IN will eliminate duplicates anyways. This avoids an extra
> sort/uniquify step.
FWIW, CVS tip realizes that it doesn't need two unique-ification steps
in this scenario. But I agree that UNION ALL is the cleaner way to
write the query.
regards, tom lane