X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4416F475F6A for ; Thu, 1 May 2003 18:20:11 -0400 (EDT) Received: from stamp.musicrebellion.com (ns2.musicrebellion.com [12.109.75.243]) by postgresql.org (Postfix) with ESMTP id E6597474E4F for ; Thu, 1 May 2003 18:20:00 -0400 (EDT) Received: from [10.0.0.102] (helo=musicrebellion.com ident=kris) by stamp.musicrebellion.com with esmtp (Exim 3.35 #1 (Debian)) id 19BMPL-0006BE-00 for ; Thu, 01 May 2003 17:20:03 -0500 Message-ID: <3EB19D92.6050400@musicrebellion.com> Date: Thu, 01 May 2003 17:20:02 -0500 From: Kris Kiger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1 X-Accept-Language: en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Functions in postgres References: <3EA98DEE.AB4F960D@webhart.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-19.4 required=5.0 tests=BAYES_01,REFERENCES,USER_AGENT_MOZILLA_UA autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/16 X-Sequence-Number: 8578 Hey all, here's a question that I think can be easily answered by those of you with more experience than I. What are the advantages/disadvantages of using a function with postgres as opposed to putting all of the SQL in an external file (a web page for example)? The only advantages that I can see is that if you want to isolate an entire process or want to associate a trigger with it, you can. Also, I suppose it could cut down on a bit of network traffic by sending only the needed variables rather than the entire query. Aside from this however, does it offer any kind of performance increase (ie stored query plan, pre-compiled, etc)? Thanks for the insite Kris