pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Lewis <mark.lewis@mir3.com>
To: George Woodring <george.woodring@iglass.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Question about DBCP prepared statement pooling with
Date: Wed, 01 Mar 2006 14:35:23 -0800
Message-ID: <1141252523.12885.21.camel@archimedes> (raw)
In-Reply-To: <1B1B254441DB31448BD34C5BD73B0B8B28FD26@PHOENIX.istructure.com>
References: <1B1B254441DB31448BD34C5BD73B0B8B28FD26@PHOENIX.istructure.com>

If the heavily updated database is so heavily updated that statistics
are wildly volatile, such as one table having 5 million rows one minute
and a dozen the next minute, then back to 5 million, then you probably
don't want to use server-side prepared plans.

More likely however is that even if your database is heavily updated,
the average statistical properties of the tables don't change much, in
which case using server-side prepared plans is usually a good thing.

If you've decided that the statistical distribution of your data doesn't
change too much and you'd like to use server-side prepared plans, then
look at the docs here for how to make JDBC PreparedStatement == Server
prepared plan: http://jdbc.postgresql.org/documentation/81/server-
prepare.html

-- Mark Lewis

On Wed, 2006-03-01 at 17:00 -0500, George Woodring wrote:
> We are looking at implementing prepared statement pooling and I have a
> question if it provides any gains with a heavily updated database.  I am
> worried that the query plans will become stale an inefficient.
> 
> A coworker mentioned "jdbc prepared statement" != "psql or perl prepared
> statement" and it is recommended for web environments (which we are).
> 
> Any suggestions would be appreciated.
> 
> Thanks,
> Woody
> 
> ----------------------------------------
> iGLASS Networks
> 211-A S. Salem St
> Apex NC 27502
> (919) 387-3550 x813
> www.iglass.net
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster



view thread (2+ messages)

Message-ID: <1141252523.12885.21.camel@archimedes>
Permalink:  ../1141252523.12885.21.camel@archimedes/
Also on:    postgresql.org/message-id/1141252523.12885.21.camel@archimedes

 · 

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: mark.lewis@mir3.com, george.woodring@iglass.net
  Subject: Re: Question about DBCP prepared statement pooling with
  In-Reply-To: <1141252523.12885.21.camel@archimedes>
  References: <1B1B254441DB31448BD34C5BD73B0B8B28FD26@PHOENIX.istructure.com> <1141252523.12885.21.camel@archimedes>

* 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