Re: IN vs EXISTS - Mailing list pgsql-general

From Tom Lane
Subject Re: IN vs EXISTS
Date
Msg-id 20156.1212851950@sss.pgh.pa.us
Whole thread Raw
In response to IN vs EXISTS  (askel <dummy666@mail.ru>)
List pgsql-general
askel <dummy666@mail.ru> writes:
> Performance is at least few times better when EXISTS is used.

It really shouldn't be.  PG knows more possible plans for IN than
EXISTS, so IN should pretty much always be equal or better ... unless
the planner is making the wrong choice.  I speculate that you have
out-of-date statistics or some such.  Have you compared EXPLAIN ANALYZE
output for the two cases?  Which PG version are we talking about?

            regards, tom lane

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: temporarily deactivate an index
Next
From: Tom Lane
Date:
Subject: Re: Extracting data from deprecated MONEY fields