Re: [HACKERS] Slow - grindingly slow - query - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Slow - grindingly slow - query
Date
Msg-id 16514.942357396@sss.pgh.pa.us
Whole thread Raw
In response to Slow - grindingly slow - query  (Theo Kramer <theo@flame.co.za>)
List pgsql-hackers
Theo Kramer <theo@flame.co.za> writes:
> The query is

>   select accountdetail.domain from accountdetail where
>     accountdetail.domain not in
>       (select accountmaster.domain from accountmaster);

Try something like
 select accountdetail.domain from accountdetail where   not exists (select accountmaster.domain from accountmaster
where              accountmaster.domain = accountdetail.domain);
 

I believe this is in the FAQ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: psql and \p\g
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: psql and \p\g