From: Graham Leggett <minfrin@sharp.fm>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Picking up strange queries for "pg_catalog"
Date: Wed, 7 Jul 2010 02:36:50 +0200
Message-ID: <D394E16B-80F1-4E2E-A2F6-FFD913EBAED2@sharp.fm> (raw)
In-Reply-To: <i0pr2d$211$1@dough.gmane.org>
References: <D1BEEF82-02F2-4CFD-BBD3-EA0AFFA0AFF8@sharp.fm>
<i0pr2d$211$1@dough.gmane.org>
On 04 Jul 2010, at 1:25 PM, Thomas Kellerer wrote:
> I don't think it's the driver "making" these calls. Some of them
> look like they are a result of calling severl JDBC metadata API
> functions (e.g DatabaseMetaData.getColumns() or something similar)
> which in turn are not initiated by the driver, but by the client
> software. So I would suspect the transaction manager or your ORM
> library to make those calls (and thus generating the queries)
I have managed to isolate at least one of the strange queries to a
call to the "getColumnTypeName()" method on the following object:
org.postgresql.jdbc3.Jdbc3ResultSetMetaData
The debugger catches what I think are internal fields inside the above
object called "schemaNameCache" and "tableNameCache", both of which
are null.
In theory it looks like the Jdbc3ResultSetMetaData object is firing
off database queries on calls to metadata methods over and over again.
Am I on the right track, and if so, is there a way to get the JDBC
driver's org.postgresql.jdbc3.Jdbc3ResultSetMetaData object to cache
these calls so that they aren't as expensive?
Regards,
Graham
--
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: minfrin@sharp.fm, spam_eater@gmx.net
Subject: Re: Picking up strange queries for "pg_catalog"
In-Reply-To: <D394E16B-80F1-4E2E-A2F6-FFD913EBAED2@sharp.fm>
References: <D1BEEF82-02F2-4CFD-BBD3-EA0AFFA0AFF8@sharp.fm> <i0pr2d$211$1@dough.gmane.org> <D394E16B-80F1-4E2E-A2F6-FFD913EBAED2@sharp.fm>
* 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