in reply to Comparing an array to a DBI table

A similar question recently came up on the dbi-users mailing list. Check out the discussion in the archives, starting at Checking for the existence of a certain row.

Quick summary: EXISTS is faster than COUNT(*) if the value exists in the column, especially if the column is indexed, but if the value doesn't exist in the column the query's going to be slow no matter what.