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

Re: Automatic optimization of IN clauses via INNER JOIN

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Thomas Hamilton <thomashamilton76(at)yahoo(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Automatic optimization of IN clauses via INNER JOIN
Date: 2009-12-17 18:05:28
Message-ID: 603c8f070912171005u557eeedcgaa08f74ffed68b0@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Thu, Dec 17, 2009 at 10:23 AM, Thomas Hamilton
<thomashamilton76(at)yahoo(dot)com> wrote:
> Apparently the latest version of MySQL has solved this problem: http://www.xaprb.com/blog/2006/06/28/why-large-in-clauses-are-problematic/
>
> But I am running PostgreSQL v8.3 and am observing generally that SELECT ... WHERE ... IN (a, b, c, ...) is much slower than SELECT ... INNER JOIN (SELECT a UNION ALL SELECT b UNION ALL SELECT c ...)

That's certainly not MY observation.  It would be interesting to see
what's going on in your case but you'll need to provide more details.

http://wiki.postgresql.org/wiki/Guide_to_reporting_problems

...Robert

In response to

Responses

pgsql-performance by date

Next:From: Grzegorz JaśkiewiczDate: 2009-12-17 20:05:28
Subject: Re: Automatic optimization of IN clauses via INNER JOIN
Previous:From: Tom LaneDate: 2009-12-17 15:57:15
Subject: Re: Automatic optimization of IN clauses via INNER JOIN

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