Re: simple functions, huge overhead, no cache

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Josip Rodin <joy(at)entuzijast(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: simple functions, huge overhead, no cache
Date: 2010-07-12 06:06:43
Message-ID: 4C3AB0F3.9060205@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/07/2010 5:46 AM, Pavel Stehule wrote:

> any using a non simple expression is very slow - so there can be some
> a warning when people use it. Sometimes people don't know (me too),
> when use expensive expression
>
> for example
>
> rowvar := (10,20)
>
> it isn't simple - I am not sure, if it is true still.

Rather than warning whenever the SPI is invoked from PL/PgSQL, perhaps
this would be a task better suited for inclusion in a profiler feature
for the PL/PgSQL debugger?

I'm not particularly interested in the notion myself, but I don't think
warnings about "non-simple" statements would be very helpful. You'd be
drowned in warnings for statements that were a necessary part of the
operation of your functions, things for which there was no other way to
do it.

It seems like a profiler, which is designed to filter and organize the
collected data, and which can be attached only to specific functions
that you want to know about, might be a better job. As there's already a
PL/PgSQL debugger, some of the infrastructure required is already present.

Meh, personally I'll stick to the good old profiling methods "is it fast
enough", "\timing", and "explain analyze".

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fujii Masao 2010-07-12 06:25:08 Re: Queries about PostgreSQL PITR
Previous Message Marcus Engene 2010-07-11 13:13:21 Re: Plan for in with one argument