X-Original-To: pgsql-performance@postgresql.org Received: from pd4mo2so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by postgresql.org (Postfix) with ESMTP id B4C06475CA9 for ; Sat, 8 Mar 2003 13:22:37 -0500 (EST) Received: from pd5mr2so.prod.shaw.ca (pd5mr2so-qfe3.prod.shaw.ca [10.0.141.233]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0HBG00MK40DPV2@l-daemon> for pgsql-performance@postgresql.org; Sat, 08 Mar 2003 11:22:37 -0700 (MST) Received: from pn2ml8so.prod.shaw.ca (pn2ml8so-qfe0.prod.shaw.ca [10.0.121.152]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0HBG00LNE0DPQN@l-daemon> for pgsql-performance@postgresql.org; Sat, 08 Mar 2003 11:22:37 -0700 (MST) Received: from power ([24.80.229.122]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0HBG002KH0DOJJ@l-daemon> for pgsql-performance@postgresql.org; Sat, 08 Mar 2003 11:22:37 -0700 (MST) Date: Sat, 08 Mar 2003 10:34:01 -0800 From: Daniel Bruce Lynes Subject: Re: Stored Procedures and compiling In-reply-to: <3240.1047093204@sss.pgh.pa.us> To: PostgreSQL Performance Message-id: <200303081034.01935.dlynes@shaw.ca> MIME-version: 1.0 X-Mailer: KMail [version 1.4] Content-type: text/plain; charset=gb2312 Content-transfer-encoding: 7BIT References: <200303071321.09981.dlynes@shaw.ca> <3240.1047093204@sss.pgh.pa.us> X-Archive-Number: 200303/66 X-Sequence-Number: 1364 On Friday 07 March 2003 19:13, Tom Lane wrote: > What exactly do you consider "compiling", and why do you think that > whatever Oracle does (which you didn't bother to explain) is superior > to what plpgsql does? When you run a script to place a stored procedure into Oracle, it checks the entire script to ensure that there are no syntax errors in both the procedural code and the SQL code. However, with PostgreSQL, if there are errors in the code, I usually don't find out about it until I reach that branch in the logic upon execution of the stored procedure from client code. As I understand it, Oracle also compiles the stored procedure into pcode (internally), the first time it is called so that it runs faster. You can compile stored procedures into pcode manually also, and store the pcode in the database, rather than the pl/sql code.