Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 07C9D9FC404 for ; Fri, 10 Aug 2007 05:06:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 05302-01-3 for ; Fri, 10 Aug 2007 05:06:15 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by postgresql.org (Postfix) with ESMTP id 07C279FC453 for ; Fri, 10 Aug 2007 05:04:40 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d32so1513897pye for ; Fri, 10 Aug 2007 01:04:39 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=e8OzfOJ4vtPXaxJsrupFhVPbEy+0dNHmaZqaotmtToZa4T0wBa29SnmBCuJ/3FISwGln6fZvX0lNf/8QHX5CLTfolC4P1VQWRXKvI1zSNIm7g+QWOXGmZV+M3Kaew3dC1goslhZAZxJPOaDdiBP0BfVecY2/YtWfZJYcyeOzcB8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Jh2qSWmqqtcxozEqdbgzI4YBoHX8zFpluN0h7mz+2Tp4gGc5NPvpi8hNNspbGcvjyYuUnyCu25dj8gwSeVADMCOP02zPQ4vCl65Nlhb2zQsfLLETGJB59titeH2M3mibQFcnqaEItlAjYHdCR2Guyup2dL21w/1BS9XI7+KVeds= Received: by 10.35.109.2 with SMTP id l2mr4753627pym.1186733079196; Fri, 10 Aug 2007 01:04:39 -0700 (PDT) Received: by 10.35.62.17 with HTTP; Fri, 10 Aug 2007 01:04:39 -0700 (PDT) Message-ID: <809bf8d30708100104r1d5de68ey8d553173090874a1@mail.gmail.com> Date: Fri, 10 Aug 2007 10:04:39 +0200 From: "=?ISO-8859-1?Q?L=E1szl=F3_Horny=E1k?=" To: "Paul van den Bogaard" Subject: Re: statement caching patch from Laszlo Hornyak for review Cc: "Oliver Jowett" , "Dave Cramer" , "Kris Jurka" , List In-Reply-To: <670726BC-C614-41DA-B1F3-03DC49441690@sun.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_13454_32651973.1186733079132" References: <2937D635-FCCB-471A-B1DA-AF0E0E0C18EB@fastcrypt.com> <46B1B5CE.1050409@opencloud.com> <33E43614-DF0E-4913-92DB-2E8EC4B1E156@fastcrypt.com> <46B3B590.5060600@opencloud.com> <531718e20708032347q87bf7efs11e748cbb61847aa@mail.gmail.com> <670726BC-C614-41DA-B1F3-03DC49441690@sun.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/47 X-Sequence-Number: 17360 ------=_Part_13454_32651973.1186733079132 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi! A short summary of the wrapper/patch-the-core question, feel free to extend it. Advantages of the prepared statement caching feature coded into the JDBC Driver: - Better performance for preparedstatements if the connection is establishe= d with DriverManager or the pg DataSource implementation. I will post some benchmark result... - Easy to configure: the pg jdbc jar on the classpath and some parameters appended to the URL Disadvantages: - Lot of code compared to relatively few users (still a lot imo) Advantages of a wrapping solution: - Completely external project, helps to keep the driver codebase small - Does not add much overhead on the client side, still good performance - Works with other JDBC Drivers (not much value if most JDBC Driver does this feature) Disadvantages: - Somewhat more work to setup (still worth the little work imo): pg jdbc ja= r file plus wrapper jar file and pg JDBC URL prefixed by the wrapper URL and parameters (e.g. jdbc:wrapper[preparedStatementPoolSize=3D64;otherParam=3Dblabla]:postgresql= ://localhost/DB, feel free to suggest a more friendly look) - As external project, it is just one more thing for the programmers to kee= p an eye on Now, with the input from the mailing list, a wrapper solution is under development, since I do not have to work with a lot of existing code in thi= s case, you can expect it soon. Your input is welcome! On 09/08/07, Paul van den Bogaard wrote: > > Hi, > > I am quite new in the PostgreSQL arena. However I know there are > drivers that do implement SC (Oracle, mySQL, third party drivers for > DB2). I believe the application servers have this build in out of > pure necessity: when they needed it there simply were no drivers > available that offered this. Therefore the motivation "most of them > have it, so why should we offer it" sounds not too motivational to me. > > I believe that since a statement is part of a connection the proper > place for a pool is within that connection (to me at least from an > architectural/design point of view). I feel any self respecting > driver should offer SC. Of course in a way that can also be used by > applications that have no need for it. Either because they know each/ > most statements are a one time thing or for other reasons. Of-course > in a safe way, although I am not sure a wrapping object is the only > way to ensure this. This however is an discussion of implementation. > > Why do I dare to make this bold statement? > > First there are many more applications out there that use a database > but are not J2EE. Therefore these would not benefit from SC build > into application servers. > Second all the ISVs I have been working with (the majority in the > finance, erp, crm, telco segments) use a (transactional)database. > Some of them are using non prepared statements. Most of them are > using or planning to use prepared statements. All these ISVs use > Oracle and the Oracle JDBC driver (I only did meet one that also > offered a home made Oracle driver). They all use the SC feature. > Third these ISVs have so much work to do in their build,test,release > cycle that they will not easily accept another database. Let alone a > database that mandates the use of yet another element (the SC > wrapper) to get a feature they do need. > Fourth, the code they need to maintain is already so large that they > do not want to implement a SC feature themselves. > > Hopefully these practical reasons are also taken into consideration > in the discussion if SC needs to be(come) part of the core. > > Regards, > Paul > > ------------------------------------------------------------------------ > --------------------- > Paul van den Bogaard > Paul.vandenBogaard@sun.com > CIE -- Collaboration and ISV Engineering, Opensource Engineering group > > Sun Microsystems, Inc phone: +31 > 334 515 918 > Saturnus 1 > extentsion: x (70)15918 > 3824 ME Amersfoort mobile: +31 > 651 913 354 > The Netherlands > fax: +31 334 515 001 > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > --=20 L=E1szl=F3 Horny=E1k ------=_Part_13454_32651973.1186733079132 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi!

A short summary of the wrapper/patch-the-core question, feel fre= e to extend it.

Advantages of the prepared statement caching feature= coded into the JDBC Driver:
- Better performance for preparedstatements= if the connection is established with DriverManager or the pg DataSource i= mplementation. I will post some benchmark result...
- Easy to configure: the pg jdbc jar on the classpath and some paramete= rs appended to the URL
Disadvantages:
- Lot of code compared to relat= ively few users (still a lot imo)

Advantages of a wrapping solution:
- Completely external project, helps to keep the driver codebase small<= br>- Does not add much overhead on the client side, still good performance<= br>- Works with other JDBC Drivers (not much value if most JDBC Driver does= this feature)
Disadvantages:
- Somewhat more work to setup (still worth the little= work imo): pg jdbc jar file plus wrapper jar file and pg JDBC URL prefixed= by the wrapper URL and parameters (e.g. jdbc:wrapper[preparedStatementPool= Size=3D64;otherParam=3Dblabla]:postgresql://localhost/DB, feel free to sugg= est a more friendly look)
- As external project, it is just one more thing for the programmers to= keep an eye on

Now, with the input from the mailing list, a wrapper= solution is under development, since I do not have to work with a lot of e= xisting code in this case, you can expect it soon.
Your input is welcome!


On 0= 9/08/07, Paul van den Bogaard <Paul.Vandenbogaard@sun.com> w= rote:
Hi,
I am quite new in the PostgreSQL arena. However I know there are
driver= s that do implement SC (Oracle, mySQL, third party drivers for
DB2). I believe the application servers have this build in out of
pu= re necessity: when they needed it there simply were no drivers
available= that offered this. Therefore the motivation "most of them
have it,= so why should we offer it" sounds not too motivational to me.

I believe that since a statement is part of a connection the proper=
place for a pool is within that connection (to me at least from an
a= rchitectural/design point of view). I feel any self respecting
driver sh= ould offer SC. Of course in a way that can also be used by
applications that have no need for it. Either because they know each/most statements are a one time thing or for other reasons. Of-course
i= n a safe way, although I am not sure a wrapping object is the only
way t= o ensure this. This however is an discussion of implementation.

Why do I dare to make this bold statement?

First there are m= any more applications out there that use a database
but are not J2EE. Th= erefore these would not benefit from SC build
into application servers.
Second all the ISVs I have been working with (the majority in the
fi= nance, erp, crm, telco segments) use a (transactional)database.
Some of = them are using non prepared statements. Most of them are
using or planni= ng to use prepared statements. All these ISVs use
Oracle and the Oracle JDBC driver (I only did meet one that also
off= ered a home made Oracle driver). They all use the SC feature.
Third thes= e ISVs have so much work to do in their build,test,release
cycle that th= ey will not easily accept another database. Let alone a
database that mandates the use of yet another element (the SC
wrappe= r) to get a feature they do need.
Fourth, the code they need to maintain= is already so large that they
do not want to implement a SC feature the= mselves.

Hopefully these practical reasons are also taken into consideration=
in the discussion if SC needs to be(come) part of the core.

Rega= rds,
Paul

-------------------------------------------------------= -----------------
---------------------
Paul van den Bogaard
Paul.vandenBogaard@sun.com
CIE -- Collaborat= ion and ISV Engineering, Opensource Engineering group

Sun Microsyste= ms, Inc           &n= bsp;            = ;      phone:     &n= bsp;  +31
334 515 918
Saturnus 1
extentsion: x (70)15918
3824 ME Amersfo= ort            =             &nb= sp;        mobile:   &nbs= p;   +31
651 913 354
The Netherlands
fax:  &nb= sp;         +31 334 515 001

---------------------------(end of broadcast)---------------------= ------
TIP 2: Don't 'kill -9' the postmaster



--
L=E1szl=F3 Horny=E1k ------=_Part_13454_32651973.1186733079132--