Re: Performance difference between IN(...) and ANY(...) operator

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Gnanam <gnanam(at)zoniac(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance difference between IN(...) and ANY(...) operator
Date: 2009-07-23 23:22:41
Message-ID: 603c8f070907231622r1b98b937r7722258f267c71d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Jul 8, 2009 at 2:50 AM, Gnanam<gnanam(at)zoniac(dot)com> wrote:
> I'm using both IN and ANY() operators extensively my application.  Can
> anybody answer me on the following questions:
>        1) Which operator is advantage over the another, interms of performance?
>        2) If I've indexed these columns, will both the operators make use of index
> scanning?
>        3) Also I read from PostgreSQL documentation that there is a limit in
> passing values to IN operator.  As far as I remember, it is 1000, but then I
> don't have the web  link justifying this handy now.  If yes/no, is it
> applicable for ANY operator also?
>        4) Is there any difference in framing queries at query planner level?

You might want to have a look at this email, and Tom Lane's reply:

http://archives.postgresql.org/message-id/603c8f070810251131m4e9cf4efl8c6e877d1fbd2022@mail.gmail.com

...Robert

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message WANGRUNGVICHAISRI, SHIVESH 2009-07-23 23:47:56 Configuring Postgresql for writing BLOB at a high-rate
Previous Message Lauris Ulmanis 2009-07-23 10:47:47 Postgres user authentification or LDAP authentification