Re: Why is a hash join being used? - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: Why is a hash join being used?
Date
Msg-id 4FE4502002000025000489DA@gw.wicourts.gov
Whole thread Raw
In response to Why is a hash join being used?  (Tim Jacobs <tjacobs2@email.unc.edu>)
List pgsql-performance
Tim Jacobs <tjacobs2@email.unc.edu> wrote:

> The nested loop join performs very quickly, whereas the hash join
> is incredibly slow. If I disable the hash join temporarily then a
> nested loop join is used in the second case and is the query runs
> much more quickly. How can I change my configuration to favor the
> nested join in this case? Is this a bad idea?

Before anyone can make solid suggestions on what you might want to
change in your configuration, they would need to know more.  Please
read this page:

http://wiki.postgresql.org/wiki/SlowQueryQuestions

... and repost with your PostgreSQL version, your configuration
overrides, a description of your hardware, and EXPLAIN ANALYZE
output from the query (rather than just EXPLAIN output).

You might not be modeling your costs correctly, you might not be
allocating resources well, you might be on an old version without an
optimizer as smart as more recent versions, your statistics might be
out of date, or you might be running into an optimizer weakness of
some sort.

-Kevin

pgsql-performance by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: moving tables
Next
From: David Kerr
Date:
Subject: Drop statistics?