pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
join vs. IN statement
2+ messages / 2 participants
[nested] [flat]

* join vs. IN statement
@ 2002-03-27 15:45  Jodi Kanter <jkanter@virginia.edu>
  0 siblings, 1 reply; 2+ messages in thread

From: Jodi Kanter @ 2002-03-27 15:45 UTC (permalink / raw)
  To: pgsql-admin

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?
thanks
Jodi Kanter

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu



 

 

 

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: join vs. IN statement
@ 2002-03-27 16:36  Joe Conway <mail@joeconway.com>
  parent: Jodi Kanter <jkanter@virginia.edu>
  0 siblings, 0 replies; 2+ messages in thread

From: Joe Conway @ 2002-03-27 16:36 UTC (permalink / raw)
  To: Jodi Kanter <jkanter@virginia.edu>; +Cc: 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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-03-27 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-03-27 15:45 join vs. IN statement Jodi Kanter <jkanter@virginia.edu>
2002-03-27 16:36 ` Joe Conway <mail@joeconway.com>

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