Re: Postgresql sql query - selecting rows outside a join

From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
To: Graham Leggett <minfrin(at)sharp(dot)fm>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql sql query - selecting rows outside a join
Date: 2003-12-01 17:31:51
Message-ID: Pine.LNX.4.44.0312011831150.31748-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

On Mon, 1 Dec 2003, Graham Leggett wrote:

> Hi all,
>
> I am trying to do a query that returns all rows that are _not_ part of
> a join, and so far I cannot seem to find a query that doesn't take 30
> minutes or more to run.
>
> The basic query is "select * from tableA where tableA_id NOT IN (select
> tableA_id from tableB)".
>
> Is there a more efficient way of doing this?
>
> Regards,
> Graham
> --
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arjen van der Meijden 2003-12-01 17:32:22 Re: Postgresql sql query - selecting rows outside a join
Previous Message Graham Leggett 2003-12-01 17:15:40 Postgresql sql query - selecting rows outside a join