Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 3E6D9632D04 for ; Tue, 6 Jul 2010 21:37:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 50571-08 for ; Wed, 7 Jul 2010 00:36:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from chandler.sharp.fm (chandler.sharp.fm [72.32.122.20]) by mail.postgresql.org (Postfix) with ESMTP id E72A3632D2A for ; Tue, 6 Jul 2010 21:36:56 -0300 (ADT) Received: from chandler.sharp.fm (localhost [127.0.0.1]) by chandler.sharp.fm (Postfix) with ESMTP id ED975348030; Tue, 6 Jul 2010 19:36:54 -0500 (CDT) Received: from [10.0.0.251] (87-194-125-18.bethere.co.uk [87.194.125.18]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client did not present a certificate) (Authenticated sender: minfrin@sharp.fm) by chandler.sharp.fm (Postfix) with ESMTP id EFB5A348027; Tue, 6 Jul 2010 19:36:53 -0500 (CDT) Cc: pgsql-jdbc@postgresql.org Message-Id: From: Graham Leggett To: Thomas Kellerer In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Picking up strange queries for "pg_catalog" Date: Wed, 7 Jul 2010 02:36:50 +0200 References: X-Mailer: Apple Mail (2.936) X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.011 tagged_above=-10 required=5 tests=BAYES_20=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/32 X-Sequence-Number: 20697 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 --