From: John T. Dow <john@johntdow.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: refreshRow is slow
Date: Fri, 15 Jan 2010 22:08:44 -0500
Message-ID: <201001160309.o0G398sO050544@web2.nidhog.com> (raw)
In-Reply-To: <4B511515.6090809@opencloud.com>
On Sat, 16 Jan 2010 14:23:33 +1300, 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.
I realized that when I looked more carefully at the code.
>But yes, it could be more efficient. We'd need a static String[]
>Field.getColumnNames(Connection,Field[]) method or similar.
That would be really nice.
Another approach is to reread the entire resultset, but with hundreds of rows that's not pretty. Probably faster than many round trips to get the column names. I could have my programming look at the size of the resultset and the number of columns and decide whether to execute the query again or refreshRow.
John
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: john@johntdow.com, oliver@opencloud.com
Subject: Re: refreshRow is slow
In-Reply-To: <201001160309.o0G398sO050544@web2.nidhog.com>
References: <4B511515.6090809@opencloud.com> <201001160309.o0G398sO050544@web2.nidhog.com>
* 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