pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alex Johnson <alex@aretesystems.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow performance with join on many fields
Date: Tue, 04 Mar 2003 01:27:42 -0500
Message-ID: <20975.1046759262@sss.pgh.pa.us> (raw)
In-Reply-To: <F8F237F6-4E04-11D7-85B6-000502FCE08D@aretesystems.com>
References: <F8F237F6-4E04-11D7-85B6-000502FCE08D@aretesystems.com>

Alex Johnson <alex@aretesystems.com> writes:
> I'm looking at the following query that joins these three  
> tables:

> SELECT ...
> FROM
>       (tbl_samples
>            INNER JOIN tbl_tests USING ...
>       )
>       INNER JOIN tbl_results USING ...

You're forcing the join order; perhaps another order is preferable?  See
http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/explicit-joins.html

> This is the output from EXPLAIN:

EXPLAIN ANALYZE output would've been more useful (it would have shown
whether a different join order would be better, for one thing).

> I've done the following to try to improve performance:
> 	increased shared_buffers to 384

That's on the picayune side yet.  1000 buffers or so is where you want
to be, I think.  Also, have you run ANALYZE or VACUUM ANALYZE lately?

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <20975.1046759262@sss.pgh.pa.us>
Permalink:  ../20975.1046759262@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20975.1046759262@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, alex@aretesystems.com
  Subject: Re: Slow performance with join on many fields
  In-Reply-To: <20975.1046759262@sss.pgh.pa.us>
  References: <F8F237F6-4E04-11D7-85B6-000502FCE08D@aretesystems.com> <20975.1046759262@sss.pgh.pa.us>

* 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