Re: Performance problem in textanycat/anytextcat

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Performance problem in textanycat/anytextcat
Date: 2010-05-16 17:11:20
Message-ID: 3628.1274029880@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-05-16 17:25:12 Re: Synchronous replication patch built on SR
Previous Message Andrew Dunstan 2010-05-16 17:11:05 Re: pg_upgrade and extra_float_digits