pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ang Chin Han <angch@pintoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Hash Join not using hashed index?
Date: Wed, 28 Jun 2000 03:00:04 -0400
Message-ID: <14589.962175604@sss.pgh.pa.us> (raw)
In-Reply-To: <20000628132411.B29825@pollcities.com>
References: <20000628132411.B29825@pollcities.com>

Hash joins don't have anything to do with hash indexes.

A hash join is a join that makes use of a temporary hashtable
built on-the-fly *in memory* for that join.

The planner could choose to use an indexscan on a hash index
as an input for the join, but it'd only be likely to do so
if there is a restriction clause matching the index.  In your
example you have only a join WHERE clause.

Plain btree indexes on city.country_id and country.country_id
might work better --- at least they'd offer the option of
a merge join without doing explicit sort.

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <14589.962175604@sss.pgh.pa.us>
Permalink:  ../14589.962175604@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14589.962175604@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, angch@pintoo.com
  Subject: Re: Hash Join not using hashed index?
  In-Reply-To: <14589.962175604@sss.pgh.pa.us>
  References: <20000628132411.B29825@pollcities.com> <14589.962175604@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