Re: Pl/Perl speed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Chris Ochs" <chris(at)paymentonline(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Pl/Perl speed
Date: 2004-01-13 18:34:52
Message-ID: 12972.1074018892@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Chris Ochs" <chris(at)paymentonline(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Keith G. Murphy 2004-01-13 18:47:56 Re: Best practice? Web application: single PostgreSQL
Previous Message scott.marlowe 2004-01-13 18:34:20 Re: Nested transaction - I am a bank ??