Postgresql sql query - selecting rows outside a join

From: Graham Leggett <minfrin(at)sharp(dot)fm>
To: pgsql-general(at)postgresql(dot)org
Subject: Postgresql sql query - selecting rows outside a join
Date: 2003-12-01 17:15:40
Message-ID: 3FCB773C.8070302@sharp.fm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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
--

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2003-12-01 17:31:51 Re: Postgresql sql query - selecting rows outside a join
Previous Message Gianni Mariani 2003-12-01 16:37:02 Re: UNICODE problem on 7.4 with COPY