X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E8BF49DCABF for ; Wed, 1 Mar 2006 18:35:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23736-08 for ; Wed, 1 Mar 2006 18:35:28 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) by postgresql.org (Postfix) with ESMTP id 82B3E9DC982 for ; Wed, 1 Mar 2006 18:35:24 -0400 (AST) Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP with MS-WebStorage 6.0.6249 Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; 01 Mar 2006 14:35:23 -0800 Subject: Re: Question about DBCP prepared statement pooling with From: Mark Lewis To: George Woodring Cc: pgsql-jdbc@postgresql.org In-Reply-To: <1B1B254441DB31448BD34C5BD73B0B8B28FD26@PHOENIX.istructure.com> References: <1B1B254441DB31448BD34C5BD73B0B8B28FD26@PHOENIX.istructure.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: MIR3, Inc. Date: Wed, 01 Mar 2006 14:35:23 -0800 Message-Id: <1141252523.12885.21.camel@archimedes> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-22) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.133 required=5 tests=[AWL=0.132, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 0.133 X-Spam-Level: X-Archive-Number: 200603/7 X-Sequence-Number: 14788 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