Skip site navigation (1) Skip section navigation (2)

Re: Cost Issue - How do I force a Hash Join

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Virag Saksena" <virag(at)auptyma(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Cost Issue - How do I force a Hash Join
Date: 2006-02-21 05:35:55
Message-ID: 4360.1140500155@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"Virag Saksena" <virag(at)auptyma(dot)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

In response to

Responses

pgsql-performance by date

Next:From: Craig A. JamesDate: 2006-02-21 05:54:14
Subject: Re: Cost Issue - How do I force a Hash Join
Previous:From: Virag SaksenaDate: 2006-02-21 05:13:34
Subject: Cost Issue - How do I force a Hash Join

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group