On 18 July 2012 17:10, Nick Hofstede <Nick(dot)Hofstede(at)inventivegroup(dot)com> wrote:
> Hi,
>
> I'm surprised at the difference in speed/execution plan between two logically equivalent queries, one using IN, the other using 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