Re: Any disadvantages of using =ANY(ARRAY()) instead of IN? - Mailing list pgsql-performance

From Clemens Eisserer
Subject Re: Any disadvantages of using =ANY(ARRAY()) instead of IN?
Date
Msg-id CAFvQSYSAcrEcJS9YYuvZtiN_8DjOt3G5YOu=YZ8ksDiFdLzZuA@mail.gmail.com
Whole thread Raw
In response to Re: Any disadvantages of using =ANY(ARRAY()) instead of IN?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Any disadvantages of using =ANY(ARRAY()) instead of IN?
List pgsql-performance
Hi Tom,

Thanks for your reply.

> What PG version are we talking about here?
For development I use 9.1.3, on the production server is 8.4.7 -
happens with both cases.

> That doesn't sound like a tremendously good idea to me.
Could you elaborate on the downsides of this approach a bit?

> But with
> so few details, it's hard to comment intelligently.
> Can you provide a concrete test case?

A self contained testcase would take some time to create (and list
members willing to configure and run), so I hope a query as well as an
explain-analyze run will provide more information (done with 9.1.3):
http://pastebin.com/BGRdAPg2

Its kind of the worst-worst case which I will improve later (way too
much relations loaded through join-fetching), but its quite a good way
to show the issue. Replacing the IN with a ANY(ARRAY()) already yields
a way better plan.

Thank you in advance, Clemens

pgsql-performance by date:

Previous
From: "Walker, James Les"
Date:
Subject: Re: Tuning Postgres 9.1 on Windows
Next
From: Merlin Moncure
Date:
Subject: Re: Tuning Postgres 9.1 on Windows