pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: statement caching proof of concept
Date: Tue, 20 Jun 2006 08:15:48 +0900
Message-ID: <44973024.4010204@opencloud.com> (raw)
In-Reply-To: <4077BF73-482B-46C8-B65D-2E1FD2465294@fastcrypt.com>
References: <4077BF73-482B-46C8-B65D-2E1FD2465294@fastcrypt.com>

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



view thread (18+ messages)  latest in thread

Message-ID: <44973024.4010204@opencloud.com>
Permalink:  ../44973024.4010204@opencloud.com/
Also on:    postgresql.org/message-id/44973024.4010204@opencloud.com

 · 

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: oliver@opencloud.com, pg@fastcrypt.com
  Subject: Re: statement caching proof of concept
  In-Reply-To: <44973024.4010204@opencloud.com>
  References: <4077BF73-482B-46C8-B65D-2E1FD2465294@fastcrypt.com> <44973024.4010204@opencloud.com>

* 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