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

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

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.

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2003-10-08 23:11:59 Re: Compare rows
Previous Message Neil Conway 2003-10-08 21:48:26 Re: Presentation