Re: IMMUTABLE function's flag do not work: 7.3.4, plpgsql - Mailing list pgsql-performance

From Tom Lane
Subject Re: IMMUTABLE function's flag do not work: 7.3.4, plpgsql
Date
Msg-id 5442.1065651752@sss.pgh.pa.us
Whole thread Raw
In response to IMMUTABLE function's flag do not work: 7.3.4, plpgsql  (Andriy Tkachuk <ant@imt.com.ua>)
Responses Re: IMMUTABLE function's flag do not work: 7.3.4, plpgsql
List pgsql-performance
Andriy Tkachuk <ant@imt.com.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.

The reason the "runtime" is small in your example is that the planner
executes the function call while preparing the plan, and this isn't
counted in EXPLAIN's runtime measurement.  There's no claim anywhere
that the results of such an evaluation would be saved for other plans.

            regards, tom lane

pgsql-performance by date:

Previous
From: Neil Conway
Date:
Subject: Re: Presentation
Next
From: Josh Berkus
Date:
Subject: Re: Compare rows