Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 0F73A633EF7 for ; Wed, 13 May 2009 16:52:07 -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 44114-10 for ; Wed, 13 May 2009 16:52:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kerberos.fcon.no (165.84-49-232.nextgentel.com [84.49.232.165]) by mail.postgresql.org (Postfix) with ESMTP id BD23D633EC3 for ; Wed, 13 May 2009 16:52:05 -0300 (ADT) Received: from [10.0.0.39] (duplo.lan [10.0.0.39]) by kerberos.fcon.no (Postfix) with ESMTP id 3BB68370A6; Wed, 13 May 2009 21:52:03 +0200 (CEST) Message-ID: <4A0B24E3.3070301@fcon.no> Date: Wed, 13 May 2009 21:52:03 +0200 From: Thomas Finneid User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: Dave Cramer CC: John Lister , pgsql-jdbc@postgresql.org Subject: Re: pooled prepared statements References: <4A0978A3.6030900@fcon.no> <4A099C8F.60709@kickstone.com> <4A09C4E6.3010408@fcon.no> <4A09D04B.9070206@kickstone.com> <4A0A7D50.40704@fcon.no> <03C41048CEFD45DD97AC0DD884C8A21A@squarepi.com> <491f66a50905130821j6afa056fp947e4dbcfd09d701@mail.gmail.com> In-Reply-To: <491f66a50905130821j6afa056fp947e4dbcfd09d701@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.092 tagged_above=0 required=5 tests=AWL=-0.008, RDNS_DYNAMIC=0.1 X-Spam-Level: X-Archive-Number: 200905/76 X-Sequence-Number: 19626 Maybe your right. The query processing takes from 1-10 seconds, so planning it is not a big factor. But when the load becomes higher, as it will be as the data increases, the planning might possibly eat time which could be used elsewhere. My server, as it is now, is pushing the limits of postgres for my use, so maybe I need to reclaim as much of wasted time as possible... We'll see. thomas Dave Cramer wrote: > > > On Wed, May 13, 2009 at 10:37 AM, John Lister > wrote: > > 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. > > > While the function may be compiled, the overhead is the same for > preparing the statement inside the function. So I don't think it's a > huge win. >