pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Question about DBCP prepared statement pooling with postgres
2+ messages / 2 participants
[nested] [flat]

* Question about DBCP prepared statement pooling with postgres
@ 2006-03-01 22:00 George Woodring <george.woodring@iglass.net>
  2006-03-01 22:35 ` Re: Question about DBCP prepared statement pooling with Mark Lewis <mark.lewis@mir3.com>
  0 siblings, 1 reply; 2+ messages in thread

From: George Woodring @ 2006-03-01 22:00 UTC (permalink / raw)
  To: pgsql-jdbc

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Question about DBCP prepared statement pooling with
  2006-03-01 22:00 Question about DBCP prepared statement pooling with postgres George Woodring <george.woodring@iglass.net>
@ 2006-03-01 22:35 ` Mark Lewis <mark.lewis@mir3.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Mark Lewis @ 2006-03-01 22:35 UTC (permalink / raw)
  To: George Woodring <george.woodring@iglass.net>; +Cc: pgsql-jdbc

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-03-01 22:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-03-01 22:00 Question about DBCP prepared statement pooling with postgres George Woodring <george.woodring@iglass.net>
2006-03-01 22:35 ` Re: Question about DBCP prepared statement pooling with Mark Lewis <mark.lewis@mir3.com>

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