Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2570A6326ED for ; Wed, 11 Aug 2010 01:37:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 48322-05 for ; Wed, 11 Aug 2010 04:37:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from web7.nidhog.com (web7.nidhog.com [198.144.36.131]) by mail.postgresql.org (Postfix) with ESMTP id DE87E6324CF for ; Wed, 11 Aug 2010 01:37:22 -0300 (ADT) Received: from XP2 (static-151-201-139-26.pitt.east.verizon.net [151.201.139.26]) (authenticated bits=0) by web7.nidhog.com (8.14.4/8.14.3) with ESMTP id o7B4kZSQ053206; Wed, 11 Aug 2010 00:46:38 -0400 (EDT) (envelope-from john@johntdow.com) Message-Id: <201008110446.o7B4kZSQ053206@web7.nidhog.com> From: "John T. Dow" To: "Kris Jurka" Cc: "pgsql-jdbc" Date: Wed, 11 Aug 2010 00:36:54 -0400 X-Mailer: PMMail 2000 Professional (2.20.2717) For Windows 2000 (5.1.2600;3) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Re: 9.0 Driver X-yoursite-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: o7B4kZSQ053206 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: john@johntdow.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201008/47 X-Sequence-Number: 20850 On Tue, 10 Aug 2010 13:56:27 -0400 (EDT), Kris Jurka wrote: > > >On Sun, 8 Aug 2010, John T. Dow wrote: > >> There is, I believe, a problem with the JDBC driver in that it gives >> very poor performance doing a refreshRow. The problem is that the driver >> queries the server for every column in the resultset. >> >> I implemented a quick and dirty fix by modifying the driver to (on >> demand) use the labels returned in the resultset. >> >> This solution of course will fail if the original query used an alias >> for a column. Other than that, it seems to be a good solution. >> >> Apparently I am the only one who uses refreshrow, because I reported the >> fact that it was slow in January (and there was a little discussion) but >> when in April I reported my crude solution there was no discussion. > >I think it's a combination of factors, few people use refreshRow and fewer >people use it on results with hundreds of columns. Yes, it is slow, but >it isn't abysmal and it's only slow for the first refreshRow execution >on the ResultSet, so subsequent refreshes are fast. As you've stated, the >solution you've implemented is inadequate for the general case, so I'm not >sure what further discussion there should be about it. Is there something >in particular you'd like feedback on? > >So yes, it's a known issue, but not a high priority one. > >Kris Jurka > > I see that once a field gets its name, it remembers it. You're right about that. I am not looking for any feedback on my quick and dirty solution, although it seemed that if others were experiencing the problem they might be interested to know that there is a solution of sorts at hand. Didn't happen. I must be alone. All I know is a client complained that it was taking 20 seconds for their remote warehouse staff to update the database. Made me look bad after I'd sold them on PG. (I timed it - it wasn't always that bad, but after I implemented my fix and tested it several times, it dropped from 15 seconds to 3 seconds to do a refreshRow.) I should think the code could get all the attname, attnum pairs for a given attrelid with one round trip and cache the results. Is there some good reason not to do so? John