On Mon, 23 Oct 2000, najm Hashmi wrote:
> Hi, I would to know if there is any articles or books that talk about
> pl/pgsql performance especially versus C. Thanking you in advance for
> your help.
I can only say what the documentation says about it in the "Overview"
section (please read it if you hadn't done it yet). In practical use I
didn't feel any disadvantages in speed comparing to simple queries from
psql prompt. Recursive PLPGSQL functions may be slow but I don't think it
depends on PLPGSQL internals---IMHO the same queries would be slow from C
as well. The performance generally depends on the number of queries you
send. I don't suggest submitting a large amount of queries to the server
waiting for a few rows of results---I think it's much better submitting a
few queries and getting lots of rows.
If a query in Postgres can be solved in a fast way using SQL queries,
from PLPGSQL you can feel the same speed. I didn't experience any
differences in speed comparing SQL language functions and PLPGSQL langauge
ones, too. For me writing PLGPSQL functions are much easier because its
logic is similar to other programming languages, not like SQL's logic. But
some people are familiar with the SQL logic. For them I suggest using SQL
functions which are in general enough for everything.
Unfortunately I didn't see any benchmark about these things. I am also
interested in them. Jan, are you still using your own created language?
Zoltan