pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Morgan Curley <mcurley@e4media.com>
To: pgsql-general@postgresql.org
To: pgsql-sql@postgresql.org
Subject: Query Approach and performance
Date: Fri, 17 Aug 2001 03:29:36 -0400
Message-ID: <4.3.2.7.2.20010817031239.028d90d0@e4media.com> (raw)

Hey everyone,
On average, are multiple simple queries better performance-wise than joins?
i.e.
select A.col1 from table1 A
select B.col2 from table2 B where B.col1 = A.col1
etc

vs

select A.col1, B.col2 from table1 A, table2 B where B.col1 = A.col1

Are joins better for small/large numbers of tables?
Is there a diff?
My approach to date has been to keep queries as simple as possible, and 
when I see a need for complicated joins, I create a view and then do simple 
queries against that.

Does pg cache queries like Oracle does so that repeated queries don't need 
to go through the compile phase and run faster? Is this configurable?

Thanks,
Morgan




view thread (2+ messages)  latest in thread

Message-ID: <4.3.2.7.2.20010817031239.028d90d0@e4media.com>
Permalink:  ../4.3.2.7.2.20010817031239.028d90d0@e4media.com/
Also on:    postgresql.org/message-id/4.3.2.7.2.20010817031239.028d90d0@e4media.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mcurley@e4media.com, pgsql-general@postgresql.org
  Subject: Re: Query Approach and performance
  In-Reply-To: <4.3.2.7.2.20010817031239.028d90d0@e4media.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