Re: plperl vs plpgsql

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: plperl vs plpgsql
Date: 2005-04-15 12:57:33
Message-ID: m3ekdc42pu.fsf@knuth.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

After takin a swig o' Arrakan spice grog, alex(at)meerkatsoft(dot)com (Alex) belched out:
> i am thinking about swiching to plperl as it seems to me much more
> flexible and easier to create functions.
>
> what is the recommended PL for postgres? or which one is most widely
> used / most popular?
> is there a performance difference between plpgsql and plperl ?

If what you're trying to do is "munge text," pl/perl will be a whole
lot more suitable than pl/pgsql because it has a rich set of text
mungeing tools and string functions which pl/pgsql lacks.

If you intend to do a lot of work involving reading unmunged tuples
from this table and that, pl/pgsql provides a much more natural
syntax, and will probably be a bit faster as the query processor may
even be able to expand some of the actions, rather than needing to
treat Perl code as an "opaque blob."

I would definitely be inclined to use the more natural language for
the given task...
--
wm(X,Y):-write(X),write('@'),write(Y). wm('cbbrowne','acm.org').
http://linuxdatabases.info/info/internet.html
"If you want to talk with some experts about something, go to the bar
where they hang out, buy a round of beers, and they'll surely talk
your ear off, leaving you wiser than before.

If you, a stranger, show up at the bar, walk up to the table, and ask
them to fax you a position paper, they'll tell you to call their
office in the morning and ask for a rate sheet." -- Miguel Cruz

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alan Stange 2005-04-15 13:11:48 Re: How to improve db performance with $7K?
Previous Message Richard van den Berg 2005-04-15 12:44:47 Re: Foreign key slows down copy/insert