Re: Taking advantage of prepared statement performance

From: "Brett" <brettonator(at)excite(dot)com>
To: brettonator(at)excite(dot)com
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Taking advantage of prepared statement performance
Date: 2002-10-10 18:35:02
Message-ID: 20021010183502.C2A7129A1A@xmxpita.excite.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Sure. I have created a pretty nice jdbc benchmarking app that allowsyou to provide work objects and the number of threads to instantiate,the infrastructure invokes the threads and takes care of timing, collectingstatistics based on type of query and printing them out.I used it to basically poo poo the idea of using mysql.. Was lightingfast with selects.. 10x's faster than postgres. Then I started doingdeletes and performance fell 10 fold and it was actually slower thanmysql.. this was using mysql in a transactional way. Anyway, getting back on topic here, I'll be glad to try this and postthe results. Currently there's only one 1 1 gigabyte ram dual 600Mhzmachine where both jdbc testing app and db reside on. Soon we'll get asecond machine to put the jdbc app on. It would probably be more relevantif the testing happened on two machines as opposed to one.Only one problem, actually using the server side prepared statements. Couldyou point me to where I can find info on usin
g them or should I justperuse the past discussions on this subject? There might be updatesor gotchas which haven't been discussed publicly yet?Thanks.--- On Thu 10/10, Barry Lind &lt; barry(at)xythos(dot)com &gt; wrote:From: Barry Lind [mailto: barry(at)xythos(dot)com]To: brettonator(at)excite(dot)comCc: pgsql-jdbc(at)postgresql(dot)orgDate: Thu, 10 Oct 2002 10:48:02 -0700Subject: Re: [JDBC] Taking advantage of prepared statement performanceBrett,It might help performance. I would suggest testing it out and comparing the results with and without server side prepared statements (I am assuming you are attempting to use server side prepared statements, if not then you shouldn't see any difference in performance). Then report back to the list your findings, as I am sure there are many here that would be insterested in knowing the results.--BarryBrett wrote:&gt; &gt; Correction... version is 7.3b2&gt; &gt; &gt; --- On Thu 10/10, Brett &lt; brettonator(at)excite(dot)com &gt; wrote:&gt; &gt; *From: *Brett [mailto:
brettonator(at)excite(dot)com]&gt; *To: *pgsql-jdbc(at)postgresql(dot)org&gt; *Date: *Thu, 10 Oct 2002 13:30:00 -0400 (EDT)&gt; *Subject: *[JDBC] Taking advantage of prepared statement performance&gt; &gt; &gt; &gt; &gt; &gt; &gt; I have a web application that invokes java jdbc code for each&gt; request. Would&gt; it be faster if I stored all my prepared statements for each&gt; connection, so&gt; when I want to do a query I a) pull a connection object from the&gt; pool then&gt; b) call ps.setX; ps.setY;...; ps.executeQuery(); and not close the&gt; prepared&gt; statement? That way, another thread could grab the connection and not&gt; have to recreate the prepared statement. I would associate sets of&gt; prepared statements with connections. Would this be faster than&gt; creating a prepared statement for each web request?&gt; &gt; I am using 7.1.3b2 (for production *crosses fingers*) in case that&gt; matters.&gt; &gt; Once again thanks for any help and sorry for any formatting issues with&g
t; this message.&gt; &gt; &gt; &gt; ------------------------------------------------------------------------&gt; *Join Excite! - http://www.excite.com*&gt; The most personalized portal on the Web!

------------------------------------------------
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Brett 2002-10-10 18:39:50 Re: Taking advantage of prepared statement performance
Previous Message Nic Ferrier 2002-10-10 18:24:06 Re: Getting a ResultSet for a refcursor element.