Re: Pl/Perl speed - Mailing list pgsql-general

From Tom Lane
Subject Re: Pl/Perl speed
Date
Msg-id 12972.1074018892@sss.pgh.pa.us
Whole thread Raw
In response to Pl/Perl speed  ("Chris Ochs" <chris@paymentonline.com>)
List pgsql-general
"Chris Ochs" <chris@paymentonline.com> writes:
> I am pretty sure I know this already, but every time you run a Pl/Perl
> function it is just like running a perl script as far as having to load and
> compile the code right?

No, the perl script gets compiled only the first time the function is
invoked (within a given backend session).  Subsequent calls to the
function use the already-compiled function object.  I'm not clear on
exactly how much overhead this saves in Perl, but it's certainly not
as bad as re-loading a script on each call.

I believe all the PL languages have comparable optimizations.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Best practice? Web application: single PostgreSQL
Next
From: Richard Huxton
Date:
Subject: Re: Nested transaction - I am a bank ??