Re: [HACKERS] Slow - grindingly slow - query
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Theo Kramer <theo@flame.co.za>
Cc: pgsql-hackers@postgreSQL.org
Date: 1999-11-11T21:56:36Z
Lists: 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