Re: Mystery function error - Mailing list pgsql-sql

From Tom Lane
Subject Re: Mystery function error
Date
Msg-id 10445.1064775853@sss.pgh.pa.us
Whole thread Raw
In response to Re: Mystery function error  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
Josh Berkus <josh@agliodbs.com> writes:
> Hmmm ... this does still seem to show that plpgsql is 10% slower in
> 7.4.

Yeah, I just did some profiling to check on that, and it seems there is
extra overhead in plpgsql's exec_eval_simple_expr(), to the tune of
another palloc or two down inside CreateExprContext().  This probably
would not show up so heavily in a more complex plpgsql function, but
it's a noticeable percentage in this trivial example.

I had noticed this before but I'm not sure there's any easy solution.
Awhile back I looked at saving the exprcontext across calls instead of
creating and deleting it on each call to exec_eval_simple_expr, but the
idea broke down in situations involving recursive plpgsql functions.
I'll take another look though.
        regards, tom lane


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Mystery function error
Next
From: Dan Langille
Date:
Subject: ...