pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Scott Marlowe <smarlowe@g2switchworks.com>
Cc: RAJU kumar <raju_19db@rediffmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Hash index
Date: Tue, 30 Aug 2005 18:39:13 -0500
Message-ID: <20050830233913.GE77007@pervasive.com> (raw)
In-Reply-To: <24391.1125433203@sss.pgh.pa.us>
References: <20050826105950.23187.qmail@webmail18.rediffmail.com>
	<1125428023.28179.94.camel@state.g2switchworks.com>
	<24115.1125430346@sss.pgh.pa.us>
	<20050830201738.GD77007@pervasive.com>
	<24391.1125433203@sss.pgh.pa.us>

On Tue, Aug 30, 2005 at 04:20:03PM -0400, Tom Lane wrote:
> "Jim C. Nasby" <jnasby@pervasive.com> writes:
> > So does that mean a hash index could (theoretically) improve the
> > performance of a hash join or hash aggregation?
> 
> I don't think so --- the whole point of a hash is to do your matching
> in-memory, rather than jumping all over the disk for it ...

True, but if you have an index on the value you're hashing you should be
able to find out very quickly if it exists or not, no? So if you were
doing a hash join between two tables and one of them had a hash index on
the appropriate field, couldn't you check the index first to see if
there was a match? Granted, you could probably do the same thing with a
B-tree index, but this might be faster in some scenarios.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software        http://pervasive.com        512-569-9461



view thread (10+ messages)

Message-ID: <20050830233913.GE77007@pervasive.com>
Permalink:  ../20050830233913.GE77007@pervasive.com/
Also on:    postgresql.org/message-id/20050830233913.GE77007@pervasive.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 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-admin@postgresql.org
  Cc: jnasby@pervasive.com, tgl@sss.pgh.pa.us, smarlowe@g2switchworks.com, raju_19db@rediffmail.com
  Subject: Re: Hash index
  In-Reply-To: <20050830233913.GE77007@pervasive.com>
  References: <20050826105950.23187.qmail@webmail18.rediffmail.com> <1125428023.28179.94.camel@state.g2switchworks.com> <24115.1125430346@sss.pgh.pa.us> <20050830201738.GD77007@pervasive.com> <24391.1125433203@sss.pgh.pa.us> <20050830233913.GE77007@pervasive.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