Thread: turn off cache option

turn off cache option

From
"jungmin shin"
Date:

Hello,
 
 
I'm executing a query invoking a UDF.
It looks that Postgres use a cache for executing UDFs.
 
For example,
 
select a()
 
a is a UDF.
 
Excution time of above statement is different each time.
What is happening inside of the Postgres when I invoke a UDF in a query?
 
It is taking 200ms or 11688ms .
There is huge differences.
 
If a cache is used for this execution , can I turn off the cache option?
 
Thanks,
 
 

--
Jungmin Shin

Re: turn off cache option

From
Ragnar
Date:
On fim, 2007-04-05 at 16:31 -0400, jungmin shin wrote:
>
> I'm executing a query invoking a UDF.
> It looks that Postgres use a cache for executing UDFs.

Postgresql is not using a cache specially for executing
UDFs, apart from only compiling the function once for each
session.

>
> select a()
> Excution time of above statement is different each time.
> What is happening inside of the Postgres when I invoke a UDF in a
> query?
>
> It is taking 200ms or 11688ms .

Postgresql relies on the filesystem and operating
system to cache fisk buffers efficiently, so you are probably
just seeing the effects of that, assuming that your function is
doing the same thing each time.

>
> If a cache is used for this execution , can I turn off the cache
> option?

why would you want to do that?

gnari