Re: STABLE functions - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: STABLE functions
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961F8D@m0114.s-mxs.net
Whole thread Raw
In response to STABLE functions  (Joachim Wieland <jwieland@kawo2.rwth-aachen.de>)
List pgsql-hackers
> The point at issue is that the "stable function" classification was
> defined and implemented to provide a semantically valid way of deciding
> whether it's safe to treat an expression as an indexscan qualifier.
> There is no code that attempts to do anything else with it.

So the problem at hand seems to be, that the optimizer treats the function
as beeing too cheap (does it apply a cost at all ?). Since this function was in
Pl/SQL it should actually be doable to estimate a cost for the function from
statistics.
Is there a working way to tell the optimizer that the function is expensive,
and thus make it prefer only evaluating it once ?

Andreas



pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: Prepared queries and ANALYZE
Next
From: Gavin Sherry
Date:
Subject: INSERT/UPDATE ... RETURNING