| From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
|---|---|
| To: | Michael Meskes <meskes(at)postgresql(dot)org> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Re: Does PostgreSQL support EXISTS? |
| Date: | 2001-06-13 14:03:24 |
| Message-ID: | 200106131403.f5DE3Pr03671@candle.pha.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 2001-06-13 14:03:58 | Re: Re: Does PostgreSQL support EXISTS? |
| Previous Message | Tom Lane | 2001-06-13 14:02:05 | Re: [Help] AGGREGATE problem w/v7.0 |