Re: Slow performance with join on many fields - Mailing list pgsql-performance

From Tom Lane
Subject Re: Slow performance with join on many fields
Date
Msg-id 20975.1046759262@sss.pgh.pa.us
Whole thread Raw
In response to Slow performance with join on many fields  (Alex Johnson <alex@aretesystems.com>)
Responses Re: Slow performance with join on many fields  (Alex Johnson <alex@aretesystems.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Alex Johnson
Date:
Subject: Slow performance with join on many fields
Next
From: Alex Johnson
Date:
Subject: Re: Slow performance with join on many fields