From: Scott Marlowe <scott.marlowe@gmail.com>
To: Gerardo Herzig <gherzig@fmed.uba.ar>
Cc: postgres list <pgsql-sql@postgresql.org>
Subject: Re: advice on query joining 10 tables
Date: Mon, 10 May 2010 15:35:17 -0600
Message-ID: <AANLkTimzy8SjmlUYWWLmr85S8xZ-hB3tUIQ49gEmjQx_@mail.gmail.com> (raw)
In-Reply-To: <4BE86EBA.3070205@fmed.uba.ar>
References: <4BE8530C.6030605@fmed.uba.ar>
<AANLkTimCg_3fZ_dAHPcFQalvgO6SaFeEHHY62g45hv95@mail.gmail.com>
<4BE86EBA.3070205@fmed.uba.ar>
On Mon, May 10, 2010 at 2:38 PM, Gerardo Herzig <gherzig@fmed.uba.ar> wrote:
> 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.
Also, search the pgsql archives for "explain analyze" for lots of
posts. You can learn quite a bit trawling the archives like that.
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: scott.marlowe@gmail.com, gherzig@fmed.uba.ar
Subject: Re: advice on query joining 10 tables
In-Reply-To: <AANLkTimzy8SjmlUYWWLmr85S8xZ-hB3tUIQ49gEmjQx_@mail.gmail.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