Re: refreshRow is slow

Поиск
Список
Период
Сортировка
От John T. Dow
Тема Re: refreshRow is slow
Дата
Msg-id 201001160309.o0G398sO050544@web2.nidhog.com
обсуждение исходный текст
Ответ на Re: refreshRow is slow  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
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
manyround trips to get the column names. I could have my programming look at the size of the resultset and the number
ofcolumns and decide whether to execute the query again or refreshRow. 

John


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: refreshRow is slow
Следующее
От: Jakub Bednář
Дата:
Сообщение: Mapping Java BigDecimal