From: | Neil Conway <neilc(at)samurai(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: dynahash API questions |
Date: | 2006-11-25 06:56:30 |
Message-ID: | 1164437790.23622.254.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Smith | 2006-11-25 09:34:52 | Re: [PATCHES] [PERFORM] Direct I/O issues |
Previous Message | Marc G. Fournier | 2006-11-25 06:46:30 | First Release Candidate Uploaded ... |