Re: dynahash API questions - Mailing list pgsql-hackers

From Neil Conway
Subject Re: dynahash API questions
Date
Msg-id 1164437790.23622.254.camel@localhost.localdomain
Whole thread Raw
In response to Re: dynahash API questions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, 2006-11-25 at 01:36 -0500, Tom Lane wrote:
> The solution that's been used so far is a static variable known to
> the caller and the hash/comparison functions; see for instance
> CurTupleHashTable in executor/execGrouping.c

Ah, fair enough -- that should work.

> (Right offhand it sounds like you might be reinventing execGrouping.c
> --- what is your application exactly?)

I'm playing around with writing a memoization facility as a UDF:
cache(f, a1, a2, ...) = f(a1, a2, ...), except that cache() keeps an
internal hash of f()'s return values and uses that to avoid calling f()
when possible. Hence the need for a hash table whose keys are (a1,
a2, ...).

-Neil




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: dynahash API questions
Next
From: "Marc G. Fournier"
Date:
Subject: First Release Candidate Uploaded ...