Re: Performance problem in textanycat/anytextcat - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Performance problem in textanycat/anytextcat
Date
Msg-id 3628.1274029880@sss.pgh.pa.us
Whole thread Raw
In response to Re: Performance problem in textanycat/anytextcat  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Performance problem in textanycat/anytextcat
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Couldn't you apply this argument to any built-in immutable function whatsoever?

No, only the ones that are built on top of other functions that aren't
immutable.

I did go looking for other potential problems of the same ilk.  The only
one I can find at present is to_timestamp(double), which is an immutable
SQL function but it uses timestamptz + interval, which is marked as not
immutable.  I believe the reason for that is that if the interval
includes month or day components then the addition result can depend on
the timezone setting.  However, the usage in to_timestamp() involves only
a pure seconds component so the immutable marking should be correct.
Still, we might want to think about reimplementing to_timestamp() as a
pure C function sometime, because the current implementation is many
times slower than it needs to be.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: pg_upgrade and extra_float_digits
Next
From: Simon Riggs
Date:
Subject: Re: Synchronous replication patch built on SR