Re: refreshRow is slow

From: Kris Jurka <books(at)ejurka(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: "John T(dot) Dow" <john(at)johntdow(dot)com>, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: refreshRow is slow
Date: 2010-12-25 22:32:25
Message-ID: alpine.BSO.2.00.1012251718240.29778@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Sat, 16 Jan 2010, Oliver Jowett wrote:

> John T. Dow wrote:
>
>> Certainly that piece of code can be made more efficient. One query ought to
>> be able to return all the primary keys.
>
> It's not the PKs it is after (it's already worked those out earlier), it's
> the column names to select to populate the rest of the resultset.
>
> But yes, it could be more efficient. We'd need a static String[]
> Field.getColumnNames(Connection,Field[]) method or similar.
>

I've adjusted the fetching of all of the ResultSetMetaData attributes to
happen in one query for the entire ResultSet instead of one attribute of
one column at a time. I've adjusted the updateable ResultSet code to use
ResultSetMetaData to take advantage of this, so refreshRow should be much
faster now.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2010-12-25 22:40:34 Re: Status of setQueryTimeout
Previous Message Kris Jurka 2010-12-25 07:09:35 Re: 9.0 and pg_stat_activity.application_name