Re: Function execution costs 'n all that

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brian Hurt <bhurt(at)janestcapital(dot)com>
Cc: Neil Conway <neilc(at)samurai(dot)com>, Richard Troy <rtroy(at)ScienceTools(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Function execution costs 'n all that
Date: 2007-01-15 20:05:06
Message-ID: 19701.1168891506@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Brian Hurt <bhurt(at)janestcapital(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-01-15 20:31:29 Re: [HACKERS] Autovacuum improvements
Previous Message Richard Troy 2007-01-15 19:47:10 Re: Function execution costs 'n all that