Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 10B0E9FB5C2 for ; Thu, 30 Aug 2007 08:42:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 83717-01 for ; Thu, 30 Aug 2007 08:42:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from beaver.fastcrypt.com (beaver.fastcrypt.com [64.7.141.17]) by postgresql.org (Postfix) with ESMTP id 80FE59FB5E5 for ; Thu, 30 Aug 2007 08:42:13 -0300 (ADT) Received: from [192.168.1.14] (dcdsl.ebox.com [64.7.143.116]) by beaver.fastcrypt.com (Postfix) with ESMTP id 6E48915806A7; Thu, 30 Aug 2007 07:43:53 -0400 (EDT) In-Reply-To: <46D67C52.60902@enterprisedb.com> References: <2937D635-FCCB-471A-B1DA-AF0E0E0C18EB@fastcrypt.com> <46B1B5CE.1050409@opencloud.com> <33E43614-DF0E-4913-92DB-2E8EC4B1E156@fastcrypt.com> <46B3B590.5060600@opencloud.com> <531718e20708032347q87bf7efs11e748cbb61847aa@mail.gmail.com> <670726BC-C614-41DA-B1F3-03DC49441690@sun.com> <809bf8d30708100104r1d5de68ey8d553173090874a1@mail.gmail.com> <809bf8d30708100309n7f49e1bau933e762029442700@mail.gmail.com> <5A1478D3-8DBA-4FC2-B239-EE96A57A71C8@fastcrypt.com> <46D67C52.60902@enterprisedb.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: List Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: statement caching patch from Laszlo Hornyak for review Date: Thu, 30 Aug 2007 07:42:16 -0400 To: Heikki Linnakangas X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/103 X-Sequence-Number: 17416 On 30-Aug-07, at 4:14 AM, Heikki Linnakangas wrote: > Dave Cramer wrote: >> I just noticed this: >> >> Now that JDBC 4 has a notion of pooling built right into the >> statement >> interface it is clear (to me at least) that the implementation >> belongs >> in the driver. > > In chapter 11.6, "Reuse of Statements by Pooled Connection", the > spec says: > >> In FIGURE 11-2, the connection pool and statement pool are >> implemented by the >> application server. However, this functionality could also be >> implemented by the >> driver or underlying data source. This discussion of statement >> pooling is meant to >> allow for any of these implementations. > > The new methods added in JDBC4, setPoolable and isPoolable are for use > by applications to hint the connection pool implementation which > statements it should try to pool. Statements are poolable by > default, so > it's really for telling the pool not to bother pooling one off > queries. > > I still don't think it's wise for us to bundle a statement cache in > the > driver. If we had a server-side statement cache, or if there was some > other PostgreSQL specific trick we could take advantage of, it would > make sense to provide an interface for it. But there isn't. Well, that's yet to be discovered. We are in the process of making a wrapper driver which we will test for speed. If the same throughput can't be achieved due to the overhead of proxying the calls then there is a good argument for providing statement caching inside the driver. Dave > > -- > Heikki Linnakangas > EnterpriseDB http://www.enterprisedb.com