From: Christopher Browne <cbbrowne@acm.org>
To: pgsql-sql@postgresql.org
Subject: Re: Which is faster SQL or PL/PGSQL
Date: Sun, 19 Oct 2003 23:48:38 -0400
Message-ID: <m3u164602x.fsf@wolfe.cbbrowne.com> (raw)
References: <E1A2Mum-0005F0-1f@noon.pghoster.com>
<20031020025741.43074.qmail@web14916.mail.yahoo.com>
The world rejoiced as jinujosein@yahoo.com ("George A.J") wrote:
> i am convertingĀ an MSSQL database to Postgres. there is a lot of procedures to convert.
>
> which language is best for functions, SQL or plpgsql.
>
> which is faster . i am using postgres 7.3.2
Hmm? This doesn't seem to make much more sense than the question of
what colour a database should be ("Mauve has more RAM...").
SQL and pl/pgsql are quite distinct. If you have procedures that
require programmed logic, with things like variables and loops, SQL
generally cannot do that, and you will HAVE to use one of the embedded
languages.
If raw speed is at issue, it is quite likely that rewriting the
procedures in C would lead to code that is faster still.
But the real question is of what language you *need* to implement in.
For certain sorts of simple procedures, SQL may suffice; as complexity
grows, you will need to use one of the other languages, whether
plpgsql, plperl, plpython, C, C++, and such, and the question won't be
of speed; it will be of necessity.
--
output = ("cbbrowne" "@" "cbbrowne.com")
http://www.ntlug.org/~cbbrowne/linuxdistributions.html
Never hit someone head on, always sideswipe. Never say, "Foo's last
patch was brain-damaged", but rather, "While fixing the miscellaneous
bugs in 243.xyz [foo's patch], I found...."
-- from the Symbolics Guidelines for Sending Mail
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-sql@postgresql.org
Cc: cbbrowne@acm.org
Subject: Re: Which is faster SQL or PL/PGSQL
In-Reply-To: <m3u164602x.fsf@wolfe.cbbrowne.com>
* 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