Skip site navigation (1) Skip section navigation (2)

Re: Any disadvantages of using =ANY(ARRAY()) instead of IN?

From: Clemens Eisserer <linuxhippy(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Any disadvantages of using =ANY(ARRAY()) instead of IN?
Date: 2012-05-01 15:04:57
Message-ID: CAFvQSYSAcrEcJS9YYuvZtiN_8DjOt3G5YOu=YZ8ksDiFdLzZuA@mail.gmail.com (view raw or flat)
Thread:
Lists: 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

In response to

Responses

pgsql-performance by date

Next:From: Merlin MoncureDate: 2012-05-01 16:45:00
Subject: Re: Tuning Postgres 9.1 on Windows
Previous:From: Walker, James LesDate: 2012-05-01 14:44:15
Subject: Re: Tuning Postgres 9.1 on Windows

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group