Re: Re: Does PostgreSQL support EXISTS? - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Re: Does PostgreSQL support EXISTS?
Date
Msg-id 200106131403.f5DE3Pr03671@candle.pha.pa.us
Whole thread Raw
In response to Re: Re: Does PostgreSQL support EXISTS?  (Michael Meskes <meskes@postgresql.org>)
Responses Re: Re: Does PostgreSQL support EXISTS?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> On Wed, Jun 13, 2001 at 12:23:15PM +1000, Martijn van Oosterhout wrote:
> > 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)
>
> The latter should be faster than the former on every relational database
> system.

That surprises me because the subquery is a correlated subquery which
are usually slower on other databases that normal subqueries.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: Michael Meskes
Date:
Subject: Re: Re: Does PostgreSQL support EXISTS?
Next
From: Bruce Momjian
Date:
Subject: Re: Re: Does PostgreSQL support EXISTS?