pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndquadrant.com>
To: Kris Jurka <books@ejurka.com>
Cc: Strong, David <david.strong@unisys.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: jdbc driver performance TODO
Date: Wed, 01 Nov 2006 10:15:59 +0000
Message-ID: <1162376160.3587.25.camel@silverbirch.site> (raw)
In-Reply-To: <Pine.BSO.4.63.0610311428220.12111@leary2.csoft.net>
References: <B6419AF36AC8524082E1BC17DA2506E80329F7D5@USMV-EXCH2.na.uis.unisys.com>
	<Pine.BSO.4.63.0610311428220.12111@leary2.csoft.net>

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





view thread (8+ messages)

Message-ID: <1162376160.3587.25.camel@silverbirch.site>
Permalink:  ../1162376160.3587.25.camel@silverbirch.site/
Also on:    postgresql.org/message-id/1162376160.3587.25.camel@silverbirch.site

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: simon@2ndquadrant.com, books@ejurka.com, david.strong@unisys.com
  Subject: Re: jdbc driver performance TODO
  In-Reply-To: <1162376160.3587.25.camel@silverbirch.site>
  References: <B6419AF36AC8524082E1BC17DA2506E80329F7D5@USMV-EXCH2.na.uis.unisys.com> <Pine.BSO.4.63.0610311428220.12111@leary2.csoft.net> <1162376160.3587.25.camel@silverbirch.site>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox