From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Fuhr <mike@fuhr.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Speed of different procedural language
Date: Wed, 21 Dec 2005 22:45:11 -0500
Message-ID: <18610.1135223111@sss.pgh.pa.us> (raw)
In-Reply-To: <20051222021346.GA61585@winnie.fuhr.org>
References: <do2cr4$sc5$1@news.hub.org>
<20051221110647.GA17360@uio.no>
<20051221212442.GA59736@winnie.fuhr.org>
<20051221213810.GA27113@uio.no>
<20051221221028.GA60176@winnie.fuhr.org>
<20051222010823.GA6103@uio.no>
<20051222021346.GA61585@winnie.fuhr.org>
Michael Fuhr <mike@fuhr.org> writes:
> Try looping through two million rows with PL/Perl or PL/Tcl and
> you'll probably see significantly worse performance than with
> PL/pgSQL -- so much worse that I'd be surprised to see those languages
> make up the difference with whatever processing they'd be doing for
> each row unless it was something they're particularly good at and
> PL/pgSQL is particularly bad at.
I'd expect plpgsql to suck at purely computational tasks, compared to
the other PLs, but to win at tasks involving database access. These
are two sides of the same coin really --- plpgsql is tightly tied to the
PG query execution engine, to the extent of using it even for simply
adding 2 and 2, but that also gives it relatively low overhead for
invoking a database query. Perl, Tcl, et al have their own
computational engines and can easily beat the PG SQL engine for simple
arithmetic and string-pushing. But they pay a high overhead for
calling back into the database engine.
regards, tom lane
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: tgl@sss.pgh.pa.us, mike@fuhr.org
Subject: Re: Speed of different procedural language
In-Reply-To: <18610.1135223111@sss.pgh.pa.us>
* 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