| From: | Richard Troy <rtroy(at)ScienceTools(dot)com> |
|---|---|
| To: | Neil Conway <neilc(at)samurai(dot)com> |
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgreSQL(dot)org> |
| Subject: | Re: Function execution costs 'n all that |
| Date: | 2007-01-15 19:47:10 |
| Message-ID: | Pine.LNX.4.33.0701151144290.31545-100000@denzel.in |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, 15 Jan 2007, Neil Conway wrote:
> On Mon, 2007-01-15 at 10:51 -0800, Richard Troy wrote:
> > I therefore propose that the engine evaluate -
> > benchmark, if you will - all functions as they are ingested, or
> > vacuum-like at some later date (when valid data for testing may exist),
> > and assign a cost relative to what it already knows - the built-ins, for
> > example.
>
> That seems pretty unworkable. It is unsafe, for one: evaluating a
> function may have side effects (inside or outside the database), so the
> DBMS cannot just invoke user-defined functions at whim. Also, the
> relationship between a function's arguments and its performance will
> often be highly complex -- it would be very difficult, not too mention
> computationally infeasible, to reconstruct that relationship
> automatically, especially without any real knowledge about the
> function's behavior.
>
> -Neil
Hi Neil,
Tom had already proposed:
>
> I'm envisioning that the CREATE FUNCTION syntax would add optional
> clauses
>
> COST function-name-or-numeric-constant
> ROWS function-name-or-numeric-constant
>
> that would be used to fill these columns.
I was considering these ideas in the mix; let the user provide either a
numeric or a function, the distinction here being that instead of running
that function at planning-time, it could be run "off-line", so to speak.
Richard
--
Richard Troy, Chief Scientist
Science Tools Corporation
510-924-1363 or 202-747-1263
rtroy(at)ScienceTools(dot)com, http://ScienceTools.com/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2007-01-15 20:05:06 | Re: Function execution costs 'n all that |
| Previous Message | Brian Hurt | 2007-01-15 19:45:46 | Re: Function execution costs 'n all that |