From: j.random.programmer <javadesigner@yahoo.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Some more profiling hotspots
Date: Wed, 23 Aug 2006 20:25:16 -0700 (PDT)
Message-ID: <20060824032516.61449.qmail@web32002.mail.mud.yahoo.com> (raw)
In-Reply-To: <44ED17A1.3040708@opencloud.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: javadesigner@yahoo.com, oliver@opencloud.com
Subject: Re: Some more profiling hotspots
In-Reply-To: <20060824032516.61449.qmail@web32002.mail.mud.yahoo.com>
References: <44ED17A1.3040708@opencloud.com> <20060824032516.61449.qmail@web32002.mail.mud.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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