pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Jodi Kanter <jkanter@virginia.edu>
Cc: Postgres Admin List <pgsql-admin@postgresql.org>
Subject: Re: join vs. IN statement
Date: Wed, 27 Mar 2002 08:36:15 -0800
Message-ID: <3CA1F4FF.5000609@joeconway.com> (raw)
References: <005501c1d5a6$6c9a6630$de138f80@virginia.edu>

Jodi Kanter wrote:
> We are currently trying to determine if their is a performance 
> difference with postgres in using an IN statement in the where clause 
> vs. using a join between tables.
> 
> Is there any published documentation or someone with personal experience 
> that can answer this question? We are adding sessioning to our web 
> interface and plan to append security info to the queries run from the 
> interface.
> 
> I can add something like:     .......   AND WHERE user IN (group1, group2)
> 
> or I can do something like    .......    SELECT data FROM tables WHERE 
> group_ID(of one table) = group_ID(of another table).
> 
> Any thoughts?
> 


IN is known for being slow. See:
http://www.us.postgresql.org/docs/faq-english.html#4.22

Joe





view thread (2+ messages)

Message-ID: <3CA1F4FF.5000609@joeconway.com>
Permalink:  ../3CA1F4FF.5000609@joeconway.com/
Also on:    postgresql.org/message-id/3CA1F4FF.5000609@joeconway.com

 · 

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-admin@postgresql.org
  Cc: mail@joeconway.com, jkanter@virginia.edu
  Subject: Re: join vs. IN statement
  In-Reply-To: <3CA1F4FF.5000609@joeconway.com>
  References: <005501c1d5a6$6c9a6630$de138f80@virginia.edu> <3CA1F4FF.5000609@joeconway.com>

* 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