X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E38619FB1D7 for ; Thu, 24 Aug 2006 00:25:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 16575-01 for ; Thu, 24 Aug 2006 00:25:18 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web32002.mail.mud.yahoo.com (web32002.mail.mud.yahoo.com [68.142.207.99]) by postgresql.org (Postfix) with SMTP id 24D0D9FA147 for ; Thu, 24 Aug 2006 00:25:17 -0300 (ADT) Received: (qmail 61451 invoked by uid 60001); 24 Aug 2006 03:25:16 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=1bw9DN5QjHlMeISA/dIJo92qN2Lhw53n/dI3e+AADmsjuoAYKTZ/C4o2T47Pc2+GFq3fmFK06c2GmehzTZOSU1iizGa8+4q5F5afBbLDcTMvjuqGmI6ohUmvzoP5t/MnfpjzzMclsvH4etKshSXXp5xuh0WdLE0ZfH8llIU+T+Y= ; Message-ID: <20060824032516.61449.qmail@web32002.mail.mud.yahoo.com> Received: from [70.110.240.244] by web32002.mail.mud.yahoo.com via HTTP; Wed, 23 Aug 2006 20:25:16 PDT Date: Wed, 23 Aug 2006 20:25:16 -0700 (PDT) From: "j.random.programmer" Subject: Re: Some more profiling hotspots To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org In-Reply-To: <44ED17A1.3040708@opencloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.839 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200608/114 X-Sequence-Number: 15641 Oliver: Thanks for the quick followup ! I'm actually using a framework that I've developed, which does the standard O/R mapping from tables to java objects. So if I have a table foo: I automatically get: table_foo.java and table_fooMgr.java The above is generated using via the framework (internally using JDBC meta data). This part is NOT profiled. Once the classes are generated, JDBC meta data is never used again. So to actually run the profiled code, I say: ---------------------------------------------- Connection con = ....get connection.... for (int n = 0; n < 100000; n++) { table_foo prototype = new table_foo(); prototype.set_column_a(1); prototype.set_column_b("2"); List rows = table_fooMgr.getUsing(con, proto); } ----------------------------------------- That's it in a nutshell. The actual stuff going over the wire that the getUsing(...) method above calls is a prepared statement and the query looks like: SELECT column_a, column_b [...] from table_foo WHERE column_a=1 and column_b='2' [...] That prepared statement (and the JDBC driver code that is called) is what is really profiled under the covers. I know this is still not very detailed. The only data fetched from the database is via the above query. Unfortunately, it's hard to post the entire code because there are dependencies on the framework etc. I'm going to post a link to this framework (it's really very cool, O/R, a page templating language, many other cool things) when I have it up on the web. In the meantime, forgive my posting incomplete info...but at least this will give you a hint as to what's getting profiled. I'm running all this on: JDK 1.5.0_06 postgres 8.1 postgres 8.2dev-503 JDBC 3 driver. Best regards, --j __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com