Re: IMMUTABLE function's flag do not work: 7.3.4, plpgsql

From: Andriy Tkachuk <ant(at)imt(dot)com(dot)ua>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: IMMUTABLE function's flag do not work: 7.3.4, plpgsql
Date: 2003-10-09 07:25:33
Message-ID: 20031009101121.S29282-100000@pool.imt.com.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, 8 Oct 2003, Tom Lane wrote:

> Andriy Tkachuk <ant(at)imt(dot)com(dot)ua> writes:
> > At second. calc_total() is immutable function:
> > but it seems that it's not cached in one session:
>
> It's not supposed to be.

but it's written id doc:

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 parameter list. If this option is given, any call
of the function with all-constant arguments can be immediately
replaced with the function value.

I meant that the result of calc_total() is not "immediately replaced with the function value"
as it's written in doc, but it takes as long time as the first function call
in the session (with the same arguments).

Maybe i misunderstand something?

Thank you,
Andriy Tkachuk.

http://www.imt.com.ua

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Oliver Scheit 2003-10-09 08:29:52 go for a script! / ex: PostgreSQL vs. MySQL
Previous Message Josh Berkus 2003-10-09 05:36:59 Re: Compare rows