Re: BUG #11671: UNACCENT call with constant arg evaluated for each row - Mailing list pgsql-bugs

From Thomas
Subject Re: BUG #11671: UNACCENT call with constant arg evaluated for each row
Date
Msg-id CABAmR6fhbqt2hS0ix+bwPVYKOy_=o63H8bcFB7T4p2J=PuFiTw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #11671: UNACCENT call with constant arg evaluated for each row  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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
>

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #11671: UNACCENT call with constant arg evaluated for each row
Next
From: flashmozzg@gmail.com
Date:
Subject: BUG #11672: Bad practice in checking for disk C, SQL Shell