pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stan Bielski <bielski@ece.cmu.edu>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimizer refuses to hash join
Date: Fri, 30 Jul 2004 12:49:30 -0400
Message-ID: <24077.1091206170@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.3.96L.1040729144520.14659B-100000@elysium.pdl.cmu.edu>
References: <Pine.LNX.3.96L.1040729144520.14659B-100000@elysium.pdl.cmu.edu>

Stan Bielski <bielski@ece.cmu.edu> writes:
> On Thu, 29 Jul 2004, Tom Lane wrote:
>> Are you sure the join condition is hashjoinable?  You didn't say
>> anything about the datatypes involved ...

> My apologies. The columns that I want to join are both type 'inet'.
> Shouldn't that be hashjoinable? 

Depends on your PG version.  The raw type isn't hashjoinable, because
its '=' operator ignores the inet-vs-cidr flag.  Before 7.4 the operator
was (correctly) marked not hashjoinable.  In 7.4 it was (incorrectly)
marked hashjoinable, due no doubt to momentary brain fade on my part.
For 7.5 it is hashjoinable and the join will actually work, because we
added a specialized hash function that also ignores the inet-vs-cidr flag.

If you are joining data that is all inet or all cidr (no mixtures),
then 7.4 works okay, which is why we didn't notice the bug right away.
If that's good enough for now, you could emulate the 7.4 behavior in
earlier releases by setting the oprcanhash flag in pg_operator for the
inet equality operator.

			regards, tom lane



view thread (4+ messages)

Message-ID: <24077.1091206170@sss.pgh.pa.us>
Permalink:  ../24077.1091206170@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24077.1091206170@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, bielski@ece.cmu.edu
  Subject: Re: Optimizer refuses to hash join
  In-Reply-To: <24077.1091206170@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