pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Glaesemann <grzm@seespotcode.net>
To: Stephen Davies <scldad@sdc.com.au>
Cc: Russell Smith <mr-russ@pws.com.au>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimising "in" queries
Date: Wed, 22 Aug 2007 19:21:05 -0500
Message-ID: <D7364220-64D0-4406-A1D6-A5BA4FE67406@seespotcode.net> (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>

[Please don't top post as it makes the discussion more difficult to  
follow.]

On Aug 22, 2007, at 18:30 , Stephen Davies wrote:

> I have always thought of array processing as the thing that vector
> processors such as Cray and ETA do/did.

(I've always heard that referred to as vector processing.)

> 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?

Depending on the numbers of the IN list and other statistcs, I  
believe PostgreSQL will rewrite z in IN (a, b, ...) into either (z =  
a) OR (z = b) OR ... or somehow add it to the join list, so  
performance will vary.

Michael Glaesemann
grzm seespotcode net





view thread (13+ messages)  latest in thread

Message-ID: <D7364220-64D0-4406-A1D6-A5BA4FE67406@seespotcode.net>
Permalink:  ../D7364220-64D0-4406-A1D6-A5BA4FE67406@seespotcode.net/
Also on:    postgresql.org/message-id/D7364220-64D0-4406-A1D6-A5BA4FE67406@seespotcode.net

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: grzm@seespotcode.net, scldad@sdc.com.au, mr-russ@pws.com.au
  Subject: Re: Optimising "in" queries
  In-Reply-To: <D7364220-64D0-4406-A1D6-A5BA4FE67406@seespotcode.net>
  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> <D7364220-64D0-4406-A1D6-A5BA4FE67406@seespotcode.net>

* 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