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

Re: Cool PL/PgSQL hack :)

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Sean Chittenden <sean(at)chittenden(dot)org>,David Fetter <david(at)fetter(dot)org>
Cc: SF Postgres <sfpug(at)postgresql(dot)org>
Subject: Re: Cool PL/PgSQL hack :)
Date: 2003-05-30 16:53:07
Message-ID: 200305300953.07224.josh@agliodbs.com (view raw or flat)
Thread:
Lists: sfpug
Sean,

> But, for the sake of testing, here are a few tests:

These are way cool.   Mind posting an article on Techdocs with them?  On on 
Elein's site ... she asked me for an article ....

> PS I know the C examples didn't connect to the SPI manager, but it
> wasn't necessary for the tests given.  Fetching rows is IO bound and
> my laptop's HDD isn't what I'd call server quality so I stuck to
> purely mathematical functions for now.  pl/pgsql has a nasty habit of
> copying data with ROWTYPE's/RECORD's, whereas in C you can use a fixed
> buffer and just realloc() the space. *sigh* I wish pl/pgsql was
> smarter in that regard and would only really copy if the function had
> RETURN NEXT or returned a SETOF data.

FWIW, PL/plSQL was originally written by Jan Wieck as an intermediate step to 
developing  PL/tcl, which is what he uses.  As such, the first version was 
quite hackish, and was only moderately cleaned up by Great Bridge for Oracle 
migration.  A lot of the internals of PL/pgSQL are very inefficient and could 
do with an overhaul.

On the up side, it still beats the pants of T-SQL for flexibility ....

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

sfpug by date

Next:From: Josh BerkusDate: 2003-05-30 16:59:57
Subject: Way to go, David!
Previous:From: Sean ChittendenDate: 2003-05-30 06:08:34
Subject: Re: Cool PL/PgSQL hack :)

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