Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 00A709FB499 for ; Wed, 1 Nov 2006 15:23:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 89391-01-6 for ; Wed, 1 Nov 2006 19:23:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id CCCFA9FB507 for ; Wed, 1 Nov 2006 05:16:08 -0400 (AST) thread-index: Acb9ll1zy4pz0rN0Rsetamk9h9iLBA== Received: from [192.168.0.20] ([62.232.55.118]) by mail01.enterprisedb.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 1 Nov 2006 04:16:07 -0500 Subject: Re: jdbc driver performance TODO Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2757 From: "Simon Riggs" To: "Kris Jurka" Cc: "Strong, David" , In-Reply-To: References: Content-Type: text/plain; charset="iso-8859-1" Date: Wed, 01 Nov 2006 10:15:59 +0000 Message-ID: <1162376160.3587.25.camel@silverbirch.site> MIME-Version: 1.0 X-Mailer: Evolution 2.6.0 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Nov 2006 09:16:07.0453 (UTC) FILETIME=[5D0A84D0:01C6FD96] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/1 X-Sequence-Number: 16043 On Tue, 2006-10-31 at 14:32 -0500, Kris Jurka wrote: > > On Tue, 31 Oct 2006, Strong, David wrote: > > > Here's an observation about the JDBC driver, but I'm not sure if it's > > practical to implement. After preparing a statement, the driver still > > sends out a describe message either via the sendDescribeStatement () or > > (most likely) the sendDescribePortal () method calls in > > org.postgresql.core.v3.QueryExecutorImpl. However, as the statement has > > been prepared, it's unlikely to change and so the results of the > > sendDescribeXXX () could be requested once and then cached with the > > prepared statement. > > I'm not sure how much benefit this will actually produce, but I agree > there is duplication of work here. So we can optimise it, but only for 8.2 and below until we work out the next steps. > > Of course, if any tables referenced by the query where changed, the > > prepared statement would be caching the original structure. Although, > > I'm not sure how much of a problem this would be as changing a table's > > data types etc. might cause code to break anyway. > > Right now it's not a big deal for the driver because plans don't change, > but for 8.3 there are plans to do prepared query invalidation when > underlying tables change. At that point we'd need to detect and refetch > metadata. I'm not sure how a client would detect this change. Plus we have the difference between changed plans that change metadata and changed plans that do not change metadata. The latter might well be considered to be more common, though both are fairly rare in the context of the prepared statement. So we probably can do something with this, but plans haven't really been thought through yet. So, this is a good reminder of something to include in the mix when designs start to be proposed. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com