pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Stan Bielski <bielski@ece.cmu.edu>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimizer refuses to hash join
Date: Thu, 29 Jul 2004 09:08:55 -0700 (PDT)
Message-ID: <20040729090450.D97947@megazone.bigpanda.com> (raw)
In-Reply-To: <Pine.LNX.3.96L.1040727152629.26493I-100000@elysium.pdl.cmu.edu>
References: <Pine.LNX.3.96L.1040727152629.26493I-100000@elysium.pdl.cmu.edu>

On Tue, 27 Jul 2004, Stan Bielski wrote:

> I having a great deal of difficulty getting postgres to do a hash join.
> Even if I disable nestloop and mergejoin in postgres.conf, the optimizer
> still refuses to select hash join. This behavior is killing my
> performance.
>
> Postgres version is 7.3.2 and relevant tables are vacuum analyzed.
>
> Here's an overview of what I'm doing:
>
> I have one table of network logs ordered by time values. The other table
> is a set of hosts (approximately 60) that are infected by a worm. I want
> to do this query on the dataset:
>
> standb=# explain SELECT count (allflow_tv_sobig.tv_s) FROM
> allflow_tv_sobig, blaster_set WHERE allflow_tv_sobig.src =
> blaster_set.label AND allflow_tv_sobig.tv_s >= 1060101118::bigint and
> allflow_tv_sobig.tv_s < 1060187518::bigint;

Can you send explain analyze results for the normal case and the nested
loop case?  It's generally more useful than plain explain.

I'd also wonder if blaster_set.label is unique such that you might be able
to write the condition as an exists clause and if that's better.  If you
were running 7.4, I'd suggest IN, but that'll certainly be painful in 7.3.



view thread (4+ messages)  latest in thread

Message-ID: <20040729090450.D97947@megazone.bigpanda.com>
Permalink:  ../20040729090450.D97947@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20040729090450.D97947@megazone.bigpanda.com

 · 

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: sszabo@megazone.bigpanda.com, bielski@ece.cmu.edu
  Subject: Re: Optimizer refuses to hash join
  In-Reply-To: <20040729090450.D97947@megazone.bigpanda.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