pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guy Rouillier <guyr-ml1@burntmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: not exists clause
Date: Thu, 10 Jan 2008 23:00:23 -0500
Message-ID: <4786E9D7.10003@burntmail.com> (raw)
In-Reply-To: <4a5f56930801101215l5ae2d5bdk2db4f1873e0789ca@mail.gmail.com>
References: <4a5f56930801101215l5ae2d5bdk2db4f1873e0789ca@mail.gmail.com>

S Golly wrote:
> I cannot get the "not exists" clause of ANSI SQL to execute correctly.
> select t.col11, t.col1... from table1 t where not exists (select 1 from 
> table2 where col2 = t.col1);
> table1 has 40M + rows. if that matters.
>  
> OS is FreeBSD 6.2, postgresql version 8.2.6
>  
> Is it not supported or a bug ?
> thank you for your support.

This is really not a performance question, but a general SQL question.

select * from t1

f1
--
1
2
3

select * from t2

f1
--
1
2

select * from t1
where not exists
(
select 1
from t2
where t2.f1 = t1.f1
)

f1
--
3

-- 
Guy Rouillier



view thread (3+ messages)

Message-ID: <4786E9D7.10003@burntmail.com>
Permalink:  ../4786E9D7.10003@burntmail.com/
Also on:    postgresql.org/message-id/4786E9D7.10003@burntmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: guyr-ml1@burntmail.com
  Subject: Re: not exists clause
  In-Reply-To: <4786E9D7.10003@burntmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox