Re: Which is faster SQL or PL/PGSQL - Mailing list pgsql-sql

From Christopher Browne
Subject Re: Which is faster SQL or PL/PGSQL
Date
Msg-id m3u164602x.fsf@wolfe.cbbrowne.com
Whole thread Raw
In response to Which is faster SQL or PL/PGSQL  ("George A.J" <jinujosein@yahoo.com>)
Responses Re: Which is faster SQL or PL/PGSQL  (Michael Pohl <pgsql@newtopia.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: "George A.J"
Date:
Subject: Which is faster SQL or PL/PGSQL
Next
From: Josh Berkus
Date:
Subject: Re: Which is faster SQL or PL/PGSQL