X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 694699FA646 for ; Mon, 19 Jun 2006 20:16:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 10077-09 for ; Mon, 19 Jun 2006 20:16:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id 94B829F9316 for ; Mon, 19 Jun 2006 20:15:59 -0300 (ADT) Received: from 221x253x225x162.ap221.ftth.ucom.ne.jp ([221.253.225.162] helo=[192.168.1.171]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1FsSyH-00023H-Mx; Tue, 20 Jun 2006 11:15:54 +1200 Message-ID: <44973024.4010204@opencloud.com> Date: Tue, 20 Jun 2006 08:15:48 +0900 From: Oliver Jowett User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Dave Cramer CC: List Subject: Re: statement caching proof of concept References: <4077BF73-482B-46C8-B65D-2E1FD2465294@fastcrypt.com> In-Reply-To: <4077BF73-482B-46C8-B65D-2E1FD2465294@fastcrypt.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/59 X-Sequence-Number: 15339 Dave Cramer wrote: > This is just proof of concept. More work has to be done to make it build > properly and work properly under different jdk's Isn't there a bunch of statement state (things like fetch size, max rows, etc) that have defined defaults and this cache implementation will not provide? The "wrapper" implementation approach suffers from the usual difficulty that the "back links" such as ResultSet.getStatement() point to the wrong object. It's actually quite a bit of work to get this right.. The cached statements are vulnerable to buggy apps that mutate the statement after close, since there's no interception of those methods to check whether the wrapper statement has been closed. What exactly is the performance bottleneck you're trying to avoid by having the statement pool? If it's the parse/plan cost, I think Mark's suggestion of putting the cache at the protocol level may be simpler. If it's overall statement cost, you might be better off with a generic wrapper that is not postgresql-specific at all. -O