Re: [HACKERS] Slow - grindingly slow - query

From: Theo Kramer <theo(at)flame(dot)co(dot)za>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Slow - grindingly slow - query
Date: 1999-11-12 05:09:15
Message-ID: 382BA0FB.82D96E3C@flame.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> 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);

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vadim Mikheev 1999-11-12 05:52:29 Re: [HACKERS] Slow - grindingly slow - query
Previous Message Bruce Momjian 1999-11-12 03:50:16 Re: [HACKERS] compression in LO and other fields