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

From: Vinay Jain <vinayj(at)sarathi(dot)ncst(dot)ernet(dot)in>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Is there any method to keep table in memory at startup
Date: 2004-05-06 13:33:06
Message-ID: 409A3E92.8000307@sarathi.ncst.ernet.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan wrote:

>Vinay Jain said:
>
>
>>hi
>>ya function is declared immutable and strict... also made btree
>>index..
>>
>>
>
>
>The docs state this about immutable functions:
>
>
>IMMUTABLE indicates that the function always returns the same result when
>given the same argument values; that is, it does not do database lookups
>or otherwise use information not directly present in its argument list.
>
>
>So it appears you are lying to postgres when you declare your function to
>be immutable, because you are doing a database lookup.
>
>Why not just code your lookup table as static data immediately available
>to your function, and look it up from C directly, rather than using a
>database table? Then your function could be genuinely immutable (and fast).
>
>cheers
>
>andrew
>
>Hi
>
You mean that I should create a static table in C program itself and use
it...if i am not wrong
Ya for the time being i am doing this thing but actually table is bigger
(around 5000 rows with 6 columns)
also this table is also created and destroyed in each indchar_lt call
which is called many times in order by clause
one more thing i want it generalized so that I can include other indian
languages also..without changing code..
If there is not any method to get results fast using database table i
will have to opt this option only..
regards
Vinay

>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-05-06 13:35:21 Re: initdb failure in CVS
Previous Message Vinay Jain 2004-05-06 13:25:47 Re: Is there any method to keep table in memory at startup