"scott.marlowe" <scott.marlowe@ihs.com> writes:
> Oh, another thing is to make your select in the in() clause a select
> distinct and see if that helps. If you've got a whole bunch of duplicates
> running around in it it's sometimes faster to distinct it. Then again,
> given all the work Tom's been putting in the query planner / optimization,
> he may have already done something like that.
As of CVS tip I would not recommend inserting DISTINCT in an "IN
(subselect)" construct --- the planner will do the equivalent for itself
if it figures that's the best way. I do not recall this late at night
whether all the relevant changes were in 7.4 or not ...
regards, tom lane