Re: advice on query joining 10 tables - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: advice on query joining 10 tables
Date
Msg-id AANLkTimCg_3fZ_dAHPcFQalvgO6SaFeEHHY62g45hv95@mail.gmail.com
Whole thread Raw
In response to advice on query joining 10 tables  (Gerardo Herzig <gherzig@fmed.uba.ar>)
Responses Re: advice on query joining 10 tables  (Gerardo Herzig <gherzig@fmed.uba.ar>)
List pgsql-sql
On Mon, May 10, 2010 at 12:40 PM, Gerardo Herzig <gherzig@fmed.uba.ar> wrote:
> Hi all. Im triyng to see if i can improve the performance of a query
> (mainly a 10 table join)
>
> 1) Besides of triyng to use indexes, there is some rules of thumb to follow?

log long running queries for later analysis?

> 2) Should i try to join the bigger tables last in the query?

The query planner can do that for you automatically.

> 3) There is some place for understanding EXPLAIN better?

http://explain.depesz.com/

Here and the docs?  I've found it pretty easy to post one here and ask
for help and get it on why a query isn't running well.  Note that
explain analyze is much preferred to plain explain.


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: advice on query joining 10 tables
Next
From: Gerardo Herzig
Date:
Subject: Re: advice on query joining 10 tables