From: Gerardo Herzig <gherzig@fmed.uba.ar>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: postgres list <pgsql-sql@postgresql.org>
Subject: Re: advice on query joining 10 tables
Date: Mon, 10 May 2010 17:38:18 -0300
Message-ID: <4BE86EBA.3070205@fmed.uba.ar> (raw)
In-Reply-To: <AANLkTimCg_3fZ_dAHPcFQalvgO6SaFeEHHY62g45hv95@mail.gmail.com>
References: <4BE8530C.6030605@fmed.uba.ar>
<AANLkTimCg_3fZ_dAHPcFQalvgO6SaFeEHHY62g45hv95@mail.gmail.com>
Scott Marlowe wrote:
> 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.
>
Well, thanks Tom and Scott for the answers. I will take some more time
reading the docs. Im looking more to know better, rather than just
waiting to someone to point out my errors.
By the way, that site is cute!
Thanks again!
Gerardo
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: gherzig@fmed.uba.ar, scott.marlowe@gmail.com
Subject: Re: advice on query joining 10 tables
In-Reply-To: <4BE86EBA.3070205@fmed.uba.ar>
* 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