Re: Is there any method to keep table in memory at startup - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Is there any method to keep table in memory at startup
Date
Msg-id 2592.24.211.141.25.1083932728.squirrel@www.dunslane.net
Whole thread Raw
In response to Re: Is there any method to keep table in memory at startup  (Vinay Jain <vinayj@sarathi.ncst.ernet.in>)
Responses Re: Is there any method to keep table in memory at startup  (Vinay Jain <vinayj@sarathi.ncst.ernet.in>)
List pgsql-hackers
Vinay Jain said:
> Andrew Dunstan wrote:
>
>>
>>If course it is not loaded each time. That would be insane. If not
>>preloaded it is loaded when first called in each process, and then
>>kept. It is never unloaded (except by the termination of the process
>>that loaded it).
>>
>>It seems you have been laboring under a misapprehension.
>>
> If this is the case than I can make connection to data base in starting
>  of  indchar.so file and close connection at end of it and it should
> work.... bingo!!
> it would solve my problem
>

*sigh*

You are not getting it.

An immutable function MUST NOT DEPEND ON DATA IN THE DATABASE. Sorry to
shout but you really need to understand this.

Use static C data, not database tables. In addition to it being pure, it
will also be enormously faster than getting data from the database. Yes it
means that if you want to change the lookup data you need to recompile
your C function library, and to redo any indexes etc. that depend on the
function. That's just the way it is, I'm afraid.

cheers

andrew




pgsql-hackers by date:

Previous
From: Vinay Jain
Date:
Subject: Re: Is there any method to keep table in memory at startup
Next
From: Vinay Jain
Date:
Subject: Re: Is there any method to keep table in memory at startup