On Wed, Aug 11, 2010 at 11:01 AM, Brian Ceccarelli
<bceccarelli@net32.com> wrote:
> =A0 =A0 My complaint remains. =A0That inlined function f_return_ver_id_4(=
) is a STABLE function, inlined or not. =A0Postgres now calls it multiple t=
imes during the transaction, even though the arguments to f_return_ver_id_4=
() have not changed.
>
> =A0 =A0 STABLE no longer means STABLE. =A0This behavior is killing my per=
formance. =A0I am getting 500% to 30000% increase in latency.
We've never guaranteed that, and almost certainly never will. Marking
a function STABLE means that the planner is *allowed to assume* that
the results won't change for a given set of arguments, not that it is
*required to prevent* it from being called multiple times with the
same set of arguments.
You can certainly prevent the function from being inlined, though
(perhaps, by writing it in PL/pgsql).
--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company