Re: Error handling in plperl and pltcl - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Error handling in plperl and pltcl
Date
Msg-id 216.1100984981@sss.pgh.pa.us
Whole thread Raw
In response to Re: Error handling in plperl and pltcl  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> I get about 6900 vs 12800 msec, so for a simple pre-planned query
> it's not quite a 50% overhead.

However, that was yesterday ;-).  I did some profiling and found some
easy-to-knock-off hotspots.  Today I'm measuring about 25% overhead
for a simple SELECT, which I think is entirely acceptable considering
the cleanliness of definition that we're buying.

I changed my test cases to be

create or replace function foo(int,int) returns int as '
declare x int;
begin for i in 1 .. $1 loop   select into x unique1 from tenk1 where unique2 = $2; end loop; return x;
end' language plpgsql;

create or replace function foos(int,int) returns int as '
declare x int;
begin for i in 1 .. $1 loop   begin     select into x unique1 from tenk1 where unique2 = $2;   exception     when
othersthen null;   end; end loop; return x;
 
end' language plpgsql;

so as to minimize the extraneous overhead --- I think this is a harder
test (gives a higher number) than what I was doing yesterday.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: pgxs regression
Next
From: Tom Lane
Date:
Subject: Re: pgxs regression