Re: Re: Does PostgreSQL support EXISTS?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Nils Zonneveld <nils(at)mbit(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: Does PostgreSQL support EXISTS?
Date: 2001-06-13 02:23:15
Message-ID: 20010613122315.A30069@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jun 06, 2001 at 10:44:04PM +0200, Nils Zonneveld wrote:
>
>
> Raymond Chui wrote:
> >
> > The Subject says its all.
> >
>
> Yes 'exists' works (though I never understood the advantage to the 'in' operator).

On postgres at least, exists is faster than in.

They are equivalent though.

select x from a where v in (select v from b)
select x from a where exists (select 1 from b where a.v = b.v)
select x from a, b where a.v = b.v

are all the same. Postgres doesn't quite know that yet though.
--
Martijn van Oosterhout <kleptog(at)svana(dot)org>
http://svana.org/kleptog/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zak McGregor 2001-06-13 02:26:00 OIDS in views
Previous Message Steve Micallef 2001-06-13 00:38:30 Unix time stamp function?