Re: Performance problem in textanycat/anytextcat

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Performance problem in textanycat/anytextcat
Date: 2010-05-16 06:55:03
Message-ID: 4BEF96C7.1010200@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> So I think that labeling textanycat/anytextcat as immutable was a
> thinko, and we instead ought to label them volatile so that the planner
> can inline them no matter what the behavior of the underlying text cast
> is.

That feels backwards, having to label functions as more volatile than
they really are, just to allow optimizations elsewhere. Marking
textanycat as not immutable would forbid using it in expression indexes,
too.

> ... The planner will not inline a function if the
> resulting expression would be more volatile than the function claims
> itself to be, because sometimes the point of such a function is to
> hide the expression's volatility. ...

Could we inline the function anyway, if it came from an operator?
Presumably if you want to hide an expresssion's volatility, you use an
explicit function call - I can't imagine using an operator for that purpose.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joachim Wieland 2010-05-16 13:49:49 Re: Patch for PKST timezone
Previous Message Jaime Casanova 2010-05-16 03:27:17 Re: Performance problem in textanycat/anytextcat