Skip site navigation (1) Skip section navigation (2)

Re: Cool PL/PgSQL hack :)

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: David Fetter <david(at)fetter(dot)org>,SF Postgres <sfpug(at)postgresql(dot)org>
Subject: Re: Cool PL/PgSQL hack :)
Date: 2003-05-30 03:52:14
Message-ID: 200305292052.14580.josh@agliodbs.com (view raw or flat)
Thread:
Lists: sfpug
David, David:

> BTW, I'm doing a few similar things like a string_split that returns
> an array, and eventually--don't know quite how hard this is--similar
> operations with one-column SELECTs instead of arrays.  Am I
> reinventing the wheel here?

Yah.   Joe Conway is adding a whole battery of array-processing functions to 
7.4; if you're patient, you can have them for free.

> > That said, I'm slowly moving things over to compiled .so's which is
> > significantly faster, but this had me wondering: has anyone done any
> > comparative benchmarks of the various pl languages for PostgreSQL?

Not PL/ vs. PL/, but PL/pgSQL vs. compiled .so in  a trigger procedure yielded 
about a 60% reduction in execution time.

If I'm working on something extremely performance sensitive, I usually hire 
someone to re-write my PL/pgSQL in C.  Otherwise, I go for what each language 
is good at:

PL/pgSQL for record manipulation;
PL/Perl for text manipulation;
PL/R for aggregates

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

sfpug by date

Next:From: Sean ChittendenDate: 2003-05-30 06:08:34
Subject: Re: Cool PL/PgSQL hack :)
Previous:From: eleinDate: 2003-05-30 01:19:10
Subject: Re: Cool PL/PgSQL hack :)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group