Re: Is there any method to keep table in memory at startup

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is there any method to keep table in memory at startup
Date: 2004-05-07 12:25:28
Message-ID: 2592.24.211.141.25.1083932728.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vinay Jain 2004-05-07 12:51:25 Re: Is there any method to keep table in memory at startup
Previous Message Vinay Jain 2004-05-07 12:05:12 Re: Is there any method to keep table in memory at startup