Re: refreshRow is slow - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: refreshRow is slow
Date
Msg-id alpine.BSO.2.00.1012251718240.29778@leary.csoft.net
Whole thread Raw
In response to Re: refreshRow is slow  (Oliver Jowett <oliver@opencloud.com>)
List 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

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: 9.0 and pg_stat_activity.application_name
Next
From: Kris Jurka
Date:
Subject: Re: Status of setQueryTimeout