From: Dave Dutcher <dave@tridecap.com>
To: 'Gauri Kanekar' <meetgaurikanekar@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Nested Loop
Date: Mon, 26 Mar 2007 10:38:12 -0500
Message-ID: <004101c76fbc$c439b700$2e00a8c0@tridecap.com> (raw)
In-Reply-To: <7e4ba9550703260803l16b86ef0w42182ef762837db8@mail.gmail.com>
-----Original Message-----
>From: pgsql-performance-owner@postgresql.org On Behalf Of Gauri Kanekar
>Subject: Re: [PERFORM] Nested Loop
>
>join_collapse_limit = 1 # JOINs
Is there a reason you have this set to 1? Postgres can't consider multiple
join orders when you do that. I would try setting that back to the default
and seeing if this query is any faster.
Other than that it looked like the problems with the query might be bad
estimates of rows. One is that postgres expects there to be 1 matching row
from rd when there are actually 30. You might try increasing the statistics
targets on rd.sd and rd.sdt, reanalyzing, and seeing if that helps. Also
postgres expects the join of rd and rm to return about 27205 rows when it
actually returns 10 million. I'm not sure what you can do about that.
Maybe if Postgres gets a better estimate for rd it would then estimate the
join better.
Dave
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: dave@tridecap.com, meetgaurikanekar@gmail.com
Subject: Re: Nested Loop
In-Reply-To: <004101c76fbc$c439b700$2e00a8c0@tridecap.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