From: Alvaro Herrera <alvherre@commandprompt.com>
To: Stephen Davies <scldad@sdc.com.au>
Cc: Michael Glaesemann <grzm@seespotcode.net>
Cc: Russell Smith <mr-russ@pws.com.au>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimising "in" queries
Date: Thu, 23 Aug 2007 15:46:42 -0400
Message-ID: <20070823194642.GD31461@alvh.no-ip.org> (raw)
In-Reply-To: <200708230900.13878.scldad@sdc.com.au>
References: <200708221210.36770.scldad@sdc.com.au>
<46CC16F3.7060606@pws.com.au>
<AAF53AEE-B98C-45BD-B80F-8FA528BFB98B@seespotcode.net>
<200708230900.13878.scldad@sdc.com.au>
Stephen Davies wrote:
> Interesting semantics. I have never seen the IN syntax referred to as
> "array processing" before.
>
> I have always thought of array processing as the thing that vector
> processors such as Cray and ETA do/did.
>
> While superficially equivalent, I have always believed that IN (a,b,c)
> executed faster than =a or =b or =c. Am I wrong for PostgreSQL?
Older versions of Postgres translated IN (a, b, c) into an OR'ed list of
equalities. Nowadays it is treated as an array; I think it's translated
to = ANY ({a,b,c}), as you can see in the message you posted at the
start of this thread.
I don't think you showed us the EXPLAIN ANALYZE results that Scott
requested.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: alvherre@commandprompt.com, scldad@sdc.com.au, grzm@seespotcode.net, mr-russ@pws.com.au
Subject: Re: Optimising "in" queries
In-Reply-To: <20070823194642.GD31461@alvh.no-ip.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox