Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 40CB1633B18 for ; Wed, 13 May 2009 11:52:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 73476-01 for ; Wed, 13 May 2009 11:52:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kickstone.com (smtp.kickstone.com [87.194.183.70]) by mail.postgresql.org (Postfix) with ESMTP id DFEEE633A6A for ; Wed, 13 May 2009 11:52:40 -0300 (ADT) Received: from madras2.square-pi.com ([192.168.2.131]:4997 helo=MADRAS2) by mail.kickstone.com with esmtpa (Exim 4.69) (envelope-from ) id 1M4Fa9-0001yn-Cd; Wed, 13 May 2009 15:37:17 +0100 Message-ID: <03C41048CEFD45DD97AC0DD884C8A21A@squarepi.com> From: "John Lister" To: "Thomas Finneid" Cc: References: <4A0978A3.6030900@fcon.no> <4A099C8F.60709@kickstone.com> <4A09C4E6.3010408@fcon.no> <4A09D04B.9070206@kickstone.com> <4A0A7D50.40704@fcon.no> Subject: Re: pooled prepared statements Date: Wed, 13 May 2009 15:37:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL=0.001 X-Spam-Level: X-Archive-Number: 200905/73 X-Sequence-Number: 19623 >>> Probably easier to create a server side function instead, then. >> But wouldn't you still have to go through all the planning steps within >> the function for any queries, although i'll admit i'm not familiar with >> Postgresql functions. > > Server-side functions are compiled when installed. Since my function would > only contain simple queries that are parameterized, it would pre-compile > well. It was the simpler queries I was thinking of and the overhead in the planning(preparing) stage compared with fetching the results rather than any complexity around them For example fetching session data using a session_id on a web server which is done many times over.. Although i'm not sure how much overhead there is in the planning stages compared with actually fetching the data and if the tradeoff of complexity is worth it... JOHN