pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jim C. Nasby <decibel@decibel.org>
Cc: Christopher Petrilli <petrilli@gmail.com>
Cc: Ying Lu <ying_lu@cs.concordia.ca>
Cc: pgsql-general@postgresql.org
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL
Date: Tue, 10 May 2005 14:25:06 +1000
Message-ID: <428037A2.4060304@samurai.com> (raw)
In-Reply-To: <4407.1115698257@sss.pgh.pa.us>
References: <427F6853.90308@cs.concordia.ca>
	<427F757A.8000407@samurai.com>
	<59d991c405050908271b55e673@mail.gmail.com>
	<427F8321.5030702@samurai.com>
	<20050509163423.GH35026@decibel.org>
	<427F9211.2090008@samurai.com>
	<20050509165133.GJ35026@decibel.org>
	<427FFCD3.1010803@samurai.com>
	<4407.1115698257@sss.pgh.pa.us>

Tom Lane wrote:
> On the other hand, once you reach the target index page, a hash index
> has no better method than linear scan through all the page's index
> entries to find the actually wanted key(s)

I wonder if it would be possible to store the keys in a hash bucket in 
sorted order, provided that the necessary ordering is defined for the 
index keys -- considering the ubiquity of b+-trees in Postgres, the 
chances of an ordering being defined are pretty good. Handling overflow 
pages would be tricky: perhaps we could store the entries in a given 
page in sorted order, but not try to maintain that order for the hash 
bucket as a whole. This would mean we'd need to do a binary search for 
each page of the bucket, but that would still be a win.

-Neil



view thread (36+ messages)  latest in thread

Message-ID: <428037A2.4060304@samurai.com>
Permalink:  ../428037A2.4060304@samurai.com/
Also on:    postgresql.org/message-id/428037A2.4060304@samurai.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: neilc@samurai.com, tgl@sss.pgh.pa.us, decibel@decibel.org, petrilli@gmail.com, ying_lu@cs.concordia.ca, pgsql-general@postgresql.org
  Subject: Re: [PERFORM] "Hash index" vs. "b-tree index" (PostgreSQL
  In-Reply-To: <428037A2.4060304@samurai.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