Re: Are stored procedures pre-compiled?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Are stored procedures pre-compiled?
Date: 2002-02-22 03:15:44
Message-ID: 13439.1014347744@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2002-02-22 03:23:23 Re: Are stored procedures pre-compiled?
Previous Message Bruce Momjian 2002-02-22 03:02:04 Re: SET NULL / SET NOT NULL