Re: IN optimization in 7.2 ????? - Mailing list pgsql-general

From Bruce Momjian
Subject Re: IN optimization in 7.2 ?????
Date
Msg-id 200202181542.g1IFgjY21373@candle.pha.pa.us
Whole thread Raw
In response to Re: IN optimization in 7.2 ?????  (hubert depesz lubaczewski <depesz@depesz.pl>)
Responses Re: IN optimization in 7.2 ?????  (Shane Wright <me@shanewright.co.uk>)
List pgsql-general
hubert depesz lubaczewski wrote:
> On Mon, Feb 18, 2002 at 09:52:19AM -0500, Bruce Momjian wrote:
> > Not that I know of.
>
> strange. what could lead to this results then?
> i used to think that IN (SELECT ...) is the slowest possible way at all.
>
> depesz
>
> p.s. of course both select's use indices, and table is vacuumed

I have always wondered this too.  Seems IN evaluates the entire query
while EXISTS evaluates it for each row, or at least that is how I
understand it, so saying EXISTS is always faster may be wrong.
Comments?


--
  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: hubert depesz lubaczewski
Date:
Subject: Re: IN optimization in 7.2 ?????
Next
From: Doug McNaught
Date:
Subject: Re: Can somebody save my bacon?