Re: join vs. IN statement - Mailing list pgsql-admin

From Joe Conway
Subject Re: join vs. IN statement
Date
Msg-id 3CA1F4FF.5000609@joeconway.com
Whole thread Raw
In response to join vs. IN statement  (Jodi Kanter <jkanter@virginia.edu>)
List pgsql-admin
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



pgsql-admin by date:

Previous
From: Jodi Kanter
Date:
Subject: join vs. IN statement
Next
From: Jodi Kanter
Date:
Subject: pg_restore