Re: Postgresql sql query - selecting rows outside a join - Mailing list pgsql-general

From Pavel Stehule
Subject Re: Postgresql sql query - selecting rows outside a join
Date
Msg-id Pine.LNX.4.44.0312011831590.31748-100000@kix.fsv.cvut.cz
Whole thread Raw
In response to Postgresql sql query - selecting rows outside a join  (Graham Leggett <minfrin@sharp.fm>)
List pgsql-general
Hello

If you can, use PostgreSQL version 7.4. There is some optimalisation for
this questions. You can change your query from select .. IN (select) to
select .. exists (select). More about it you can find in FAQ.

regards
Pavel

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
>


pgsql-general by date:

Previous
From: "Arjen van der Meijden"
Date:
Subject: Re: Postgresql sql query - selecting rows outside a join
Next
From: "Toby Doig"
Date:
Subject: Re: Postgresql sql query - selecting rows outside a join