Re: help with a patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: help with a patch
Date: 2002-03-14 21:43:05
Message-ID: 200203142143.g2ELh5c26583@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway wrote:
> Hi all,
>
> I'm working on implementing unique hash indexes. I've got most of the
> code finished, but I'm stumped on how to implement the remainder. Since
> I'm still a newbie to the Postgres code, so any pointers or help would
> be much appreciated.
>
> I've been able to borrow a fair amount of code from the btree unique
> index implementation (where possible, I've tried to share code between
> hash and btree, I'll do this more in the final patch). The problem I'm
> having is the implementation of the _hash_check_unique() function. This
> is passed the Buffer which corresponds to the first page in the bucket
> chain for the key, the hash item itself, the ScanKey, as well as the
> index Relation and the heap Relation. Given this, how does one scan
> through the hash bucket to determine if a matching key is present?
>
> I can probably figure out the MVCC related code (ensuring that the
> tuples we find aren't dead, etc); what I can't figure out is the basic
> methodology required to search for matching tuples in the hash bucket.
>
> Any help would be appreciated. I've attached the current development
> version of the patch, if that is of any help.

I am not totally sure of the question, but for hash don't you have to
spin through the entire bucket and test each one.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ian Barwick 2002-03-14 22:30:09 Re: psql and output from \?
Previous Message Bruce Momjian 2002-03-14 21:40:18 Re: psql and output from \?