Re: Function execution costs 'n all that - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Function execution costs 'n all that
Date
Msg-id 19701.1168891506@sss.pgh.pa.us
Whole thread Raw
In response to Re: Function execution costs 'n all that  (Brian Hurt <bhurt@janestcapital.com>)
Responses Re: Function execution costs 'n all that  (Neil Conway <neilc@samurai.com>)
Re: Function execution costs 'n all that  (Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>)
List pgsql-hackers
Brian Hurt <bhurt@janestcapital.com> writes:
> Non-developer here, but we use a lot of plpgsql functions at work.  And 
> the functions we use fall into two broad, ill-defined catagories- 
> "expensive" functions and "cheap" functions.  What I'd like as a user is 
> some way to tell the planner "this function is expensive- prefer plans 
> which call this function less even if they're otherwise more expensive" 
> or "this function is cheap, prefer plans that are otherwise less 
> expensive even if they call this function more often".  Precise cost 
> estimates aren't that important, IMHO.

Right, so a plain constant cost would be plenty for your situation.

I suspect there's an 80/20 rule at work here --- the estimator-function
side of this will take most of the effort to design/implement, but not
get used nearly as much as the plain-constant form ... maybe we should
just do the constant for starters and see how many people really want to
write C-code estimators ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Brian Hurt
Date:
Subject: Re: Function execution costs 'n all that
Next
From: Neil Conway
Date:
Subject: Re: Function execution costs 'n all that