From: Michael Fuhr <mike@fuhr.org>
To: pgsql-performance@postgresql.org
Subject: Re: Speed of different procedural language
Date: Wed, 21 Dec 2005 14:24:42 -0700
Message-ID: <20051221212442.GA59736@winnie.fuhr.org> (raw)
In-Reply-To: <20051221110647.GA17360@uio.no>
References: <do2cr4$sc5$1@news.hub.org>
<20051221110647.GA17360@uio.no>
On Wed, Dec 21, 2005 at 12:06:47PM +0100, Steinar H. Gunderson wrote:
> On Sun, Dec 18, 2005 at 01:10:21AM -0000, Ben Trewern wrote:
> > I know I should be writing these in C but that's a bit beyond me. I was
> > going to try PL/Python or PL/Perl or even PL/Ruby. Has anyone any idea
> > which language is fastest, or is the data access going to swamp the overhead
> > of small functions?
>
> I'm not sure if it's what you ask for, but there _is_ a clear difference
> between the procedural languages -- I've had a 10x speed increase from
> rewriting PL/PgSQL stuff into PL/Perl, for instance.
The difference is clear only in specific cases; just because you
saw a 10x increase in some cases doesn't mean you can expect that
kind of increase, or indeed any increase, in others. I've seen
PL/pgSQL beat all other PL/* challengers handily many times,
especially when the function does a lot of querying and looping
through large result sets.
I tend to use PL/pgSQL except in cases where PL/pgSQL can't do what
I want or the job would be much easier in another language (e.g.,
string manipulation, for which I'd use PL/Perl or PL/Ruby). Even
then I might use the other language only to write small functions
that a PL/pgSQL function could call.
As Merlin suggested, maybe Ben could tell us what he wants to do
that he thinks should be written in C or a language other than
PL/pgSQL. Without knowing what problem is to be solved it's near
impossible to recommend an appropriate tool.
--
Michael Fuhr
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-performance@postgresql.org
Cc: mike@fuhr.org
Subject: Re: Speed of different procedural language
In-Reply-To: <20051221212442.GA59736@winnie.fuhr.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