pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: carlos.reimer@opendb.com.br
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: RES: RES: Improving select peformance
Date: Thu, 02 Aug 2007 22:13:01 -0400
Message-ID: <28235.1186107181@sss.pgh.pa.us> (raw)
In-Reply-To: <PEEPKDFEHHEMKBBFPOOKKELAFDAA.carlos.reimer@opendb.com.br>
References: <PEEPKDFEHHEMKBBFPOOKKELAFDAA.carlos.reimer@opendb.com.br>

"Carlos H. Reimer" <carlos.reimer@opendb.com.br> writes:
> In this case, I believe the best choice to improve the performance of this
> particular SQL statement is adding the 'set join_collapse_limit = 1;' just
> before the join statement, correct?

That's a mighty blunt instrument.  The real problem with your query is
the misestimation of the join sizes --- are you sure the table
statistics are up to date?  Maybe you'd get better estimates with more
statistics (ie, increase the stats target for these tables).

			regards, tom lane



view thread (3+ messages)

Message-ID: <28235.1186107181@sss.pgh.pa.us>
Permalink:  ../28235.1186107181@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28235.1186107181@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, carlos.reimer@opendb.com.br, alvherre@commandprompt.com
  Subject: Re: RES: RES: Improving select peformance
  In-Reply-To: <28235.1186107181@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