pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc G. Fournier <scrappy@postgresql.org>
To: Michael Fuhr <mike@fuhr.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: pl/* overhead ...
Date: Wed, 26 Oct 2005 06:48:41 -0300 (ADT)
Message-ID: <20051026064246.Q993@ganymede.hub.org> (raw)
In-Reply-To: <20051026065542.GA19386@winnie.fuhr.org>
References: <20051026005729.V993@ganymede.hub.org>
	<20051026065542.GA19386@winnie.fuhr.org>

On Wed, 26 Oct 2005, Michael Fuhr wrote:

> On Wed, Oct 26, 2005 at 12:58:13AM -0300, Marc G. Fournier wrote:
>> Does anyone know of, or have, any comparisions of the overhead going with
>> something like pl/perl or pl/php vs using pl/pgsql?
>
> Benchmark results will probably depend on the type of processing
> you're doing.  I'd expect PL/pgSQL to be faster at database operations
> like looping through query results, and other languages to be faster
> at non-database operations like text munging and number crunching,
> depending on the particular language's strengths.
>
> [Does quick test.]
>
> Whale oil beef hooked.  PL/pgSQL just outran PL/Perl when I expected
> the latter to win.  Hang on, let me play with it until it comes back
> with the results I want....

'k, let's repharase the questions :)

Overall, I'd expect pl/pgsql to have less overhead, since its "built into" 
the server ... in the case of something like pl/php or pl/perl, assuming 
that I don't use any external modules, is it just as 'built in', or am I 
effectively calling an external interpreter each time I run that function?

For instance, if there wasn't something like to_char() (thanks for 
pointing that one out), then i could write a simple pl/perl function that 
'simulated it', but itself did no db queries just a simple:

RETURN sprintf("%04d", intval);

Don't know if that made much more sense ... ?


----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664



view thread (4+ messages)  latest in thread

Message-ID: <20051026064246.Q993@ganymede.hub.org>
Permalink:  ../20051026064246.Q993@ganymede.hub.org/
Also on:    postgresql.org/message-id/20051026064246.Q993@ganymede.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: scrappy@postgresql.org, mike@fuhr.org
  Subject: Re: pl/* overhead ...
  In-Reply-To: <20051026064246.Q993@ganymede.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox