Re: optimizing queries using IN and EXISTS - Mailing list pgsql-performance

From Peter Geoghegan
Subject Re: optimizing queries using IN and EXISTS
Date
Msg-id CAEYLb_XxqdVKH9L1NBjk6yxhdKi-QMUrHi7KC14KbdS4cwuzDw@mail.gmail.com
Whole thread Raw
In response to optimizing queries using IN and EXISTS  (Nick Hofstede <Nick.Hofstede@inventivegroup.com>)
Responses Re: optimizing queries using IN and EXISTS
List pgsql-performance
On 18 July 2012 17:10, Nick Hofstede <Nick.Hofstede@inventivegroup.com> wrote:
> Hi,
>
> I'm surprised at the difference in speed/execution plan between two logically equivalent queries, one using IN, the
otherusing EXISTS. (At least I think they are logically equivalent) 

They are not logically equivalent.

http://www.postgresql.org/docs/current/static/functions-subquery.html

See the notes about NULL under IN.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

pgsql-performance by date:

Previous
From: Nick Hofstede
Date:
Subject: optimizing queries using IN and EXISTS
Next
From: Robert Haas
Date:
Subject: Re: Array fundamentals