Re: Hash Join not using hashed index?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ang Chin Han <angch(at)pintoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Hash Join not using hashed index?
Date: 2000-06-28 07:00:04
Message-ID: 14589.962175604@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ang Chin Han 2000-06-28 07:20:57 Re: Hash Join not using hashed index?
Previous Message Tom Lane 2000-06-28 06:15:40 Re: Problem with pg_dumpall