Re: [HACKERS] Slow - grindingly slow - query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Theo Kramer <theo(at)flame(dot)co(dot)za>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Slow - grindingly slow - query
Date: 1999-11-11 21:56:36
Message-ID: 16514.942357396@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Theo Kramer <theo(at)flame(dot)co(dot)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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergio A. Kessler 1999-11-11 22:04:20 Re: [INTERFACES] Error on db recovery..
Previous Message Bruce Momjian 1999-11-11 21:51:14 Re: failure of \e in psql