Re: [HACKERS] Slow - grindingly slow - query
Theo Kramer <theo@flame.co.za>
From: Theo Kramer <theo@flame.co.za>
To: pgsql-hackers@postgreSQL.org
Date: 1999-11-12T05:09:15Z
Lists: pgsql-hackers
Tom Lane wrote: > > 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); This takes more than 5 hours and 30 minutes. > Try something like > > select accountdetail.domain from accountdetail where > not exists (select accountmaster.domain from accountmaster where > accountmaster.domain = accountdetail.domain); This takes 5 seconds - wow! > I believe this is in the FAQ... Will check out the FAQs. Many thanks. -------- Regards Theo