Re: Storing a dynahash for an entire connection or transaction? - Mailing list pgsql-hackers

From Volkan YAZICI
Subject Re: Storing a dynahash for an entire connection or transaction?
Date
Msg-id 20061127172603.GA1448@alamut
Whole thread Raw
In response to Storing a dynahash for an entire connection or transaction?  (Greg Mitchell <gmitchell@atdesk.com>)
Responses Re: Storing a dynahash for an entire connection or transaction?
List pgsql-hackers
Hi,

On Nov 27 10:57, Greg Mitchell wrote:
> I've now got to custom datatypes that map from an int2 value on disk to 
> a string by way of a table for each. Currently, I load these tables into 
> a dynahash per function call (fcinfo->flinfo->fn_extra). This is working
> great is most situations. The problem situation is where there are many
> queries (often INSERTS) that need to happen in a short amount of time.
> This causes reloads of the dynahash (or hashes) for each query, making
> them orders of magnitude slower than when these columns were varchar.
> 
> What I'd like to do is change the way I store this hash so that it 
> doesn't need to be as frequently updated. I'm open to most any solution. 
> One type rarely ever has new values (maybe once every several months) 
> and the other gets new values once a night.

You may want to cache these values using a static variable (which will
make itself to be valid per session) that stores its values in the
(for instance) TopTransactionContext.


Regards.


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: Configuring BLCKSZ and XLOGSEGSZ (in 8.3)
Next
From: "Jim C. Nasby"
Date:
Subject: Re: [CORE] RC1 blocker issues