X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 139F0D1B4E1 for ; Sun, 28 Sep 2003 19:04:27 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 02278-05 for ; Sun, 28 Sep 2003 16:04:18 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 43368D1B4E6 for ; Sun, 28 Sep 2003 16:04:16 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h8SJ4D6c010446; Sun, 28 Sep 2003 15:04:13 -0400 (EDT) To: Josh Berkus Cc: Joe Conway , Richard Sydney-Smith , pgsql-sql@postgresql.org Subject: Re: Mystery function error In-reply-to: <200309281147.41146.josh@agliodbs.com> References: <000c01c38572$73c03c50$251a32d2@athlon2000> <9634.1064767690@sss.pgh.pa.us> <10187.1064773754@sss.pgh.pa.us> <200309281147.41146.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Sun, 28 Sep 2003 11:47:41 -0700" Date: Sun, 28 Sep 2003 15:04:13 -0400 Message-ID: <10445.1064775853@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/365 X-Sequence-Number: 15343 Josh Berkus 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