Re: Calculated view fields (8.1 != 8.2)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gaetano Mendola <mendola(at)bigfoot(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Calculated view fields (8.1 != 8.2)
Date: 2007-03-06 17:47:38
Message-ID: 6320.1173203258@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gaetano Mendola <mendola(at)bigfoot(dot)com> writes:
> [ 8.2 evaluates volatile functions in the targetlist of a view ]
> If I mark the function as STABLE or IMMUTABLE then even with version
> 8.2 the function is not evaluated. Is this the intended behavior?

Yes; people complained that we needed to be more careful about the
number of times volatile functions get evaluated.

> I didn't see something about it in the release note.

<listitem>
<para>
Do not flatten subqueries that contain <literal>volatile</>
functions in their target lists (Jaime Casanova)
</para>

<para>
This prevents surprising behavior due to multiple evaluation
of a <literal>volatile</> function (such as <function>random()</>
or <function>nextval()</>). It might cause performance
degradation in the presence of functions that are unnecessarily
marked as <literal>volatile</>.
</para>
</listitem>

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-03-06 17:48:34 Re: GIST and TOAST
Previous Message Martijn van Oosterhout 2007-03-06 17:43:19 Re: Auto creation of Partitions