"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Are stored sql or pl/pgsql (and in fact other langs) precompiled on Postgres
> for efficiency???
plpgsql is, see
http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/plpgsql.html#PLPGSQL-OVERVIEW
although "compiling" might be a bit of a strong word for producing
query plans in advance. One should certainly not mistake plpgsql
for a compiled-language substitute. It's great for issuing queries
but not for adding 2 and 2 to get 4.
plperl and pltcl do whatever the underlying implementations of those
languages do. Dunno about plpython.
I believe that SQL-language functions don't have any such optimization
at all :-( ... I think they are re-parsed and re-planned from scratch
on each call.
regards, tom lane