In a word, no. The predicates
The server software automatically eliminates duplicates in IN-lists where the size of the list is "sufficiently small" that we can incur the overhead of the sort (to eliminate the duplicate values) at compile time. This can only be done if all of the IN-list elements are known at optimization time - they must either be literal values, variables, or hostvars.
Indeed, I second the motion. Duplicates in an IN clause are NOT a problem.
However, I can say from experience that an IN clause on large number of items performs worse than an equivalent join ..
instead of doing:
select * from DataTable where ID in ( select ID from LookupTable )
try this instead:
select dt.* from ( select distinct ID from LookupTable ) x, DataTable dt where x.ID = dt.id
answered 16 May '12, 10:20