I understand that this is not a requirement for a STABLE function. Still,
from the user point of view, I think it's unfortunate =E2=80=94 and unexpec=
ted for
those who don't know about UNACCENT not being defined as IMMUTABLE =E2=80=
=94 that
UNACCENT calls will make some queries very slow (I have another table where
the execution time goes from < 400ms to 4s+ because of that).
Regards,
Thomas
On Tue, Oct 14, 2014 at 8:40 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> t.chaumeny@gmail.com writes:
> > Since UNACCENT function is defined as STABLE, I would expect its result
> to
> > be evaluated only once in the second query.
>
> The system does not promise any such thing for stable functions.
> STABLE is a marker that it is *safe* to evaluate the function fewer
> times than naive SQL semantics would suggest; it is not a requirement.
>
> regards, tom lane
>