On Wednesday 19 Mar 2003 6:23 pm, Johnson, Shaunn wrote:
> Howdy:
>
> Running PostgreSQL 7.2.1 on RedHat Linux 7.2.
>
> I'm trying to run a query and it seems by using EXPLAIN
> that it will take a long time. Is there a way to get the
> results in a more efficient manner? Basically, I want
> a list of records that are NOT in the table ref_person.
>
> [snip query]
> explain
>
> select
...
> from
> ref_person x
> where
> x.contract not in
Try rewriting the IN as an EXISTS clause - PG has traditionally not been too
clever at handling IN (though I believe this is to improve in the next
version).
--
Richard Huxton