From: Tom Lane <tgl@sss.pgh.pa.us>
To: Virag Saksena <virag@auptyma.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Cost Issue - How do I force a Hash Join
Date: Tue, 21 Feb 2006 00:35:55 -0500
Message-ID: <4360.1140500155@sss.pgh.pa.us> (raw)
In-Reply-To: <028401c636a5$907fb4b0$3100000a@demo1>
References: <028401c636a5$907fb4b0$3100000a@demo1>
"Virag Saksena" <virag@auptyma.com> writes:
> The individual queries run in 50-300 ms. However the optimizer is =
> choosing a nested loop to join them rather than a Hash join
> causing the complete query to take 500+ seconds. It expects that it will =
> get 1 row out from each of the sources, but here is gets
> several thousand rows.
The best approach is to see if you can't fix that estimation error.
Are the stats up to date on these tables? If so, maybe raising the
statistics targets would help.
regards, tom lane
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, virag@auptyma.com
Subject: Re: Cost Issue - How do I force a Hash Join
In-Reply-To: <4360.1140500155@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