Re: experience sharing: select query returns more records than necessary

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: experience sharing: select query returns more records than necessary
Дата
Msg-id 491f66a50901200407o18a8d0basf0cee02f511482eb@mail.gmail.com
обсуждение исходный текст
Ответ на experience sharing: select query returns more records than necessary  (Kent Tong <kent@cpttm.org.mo>)
Ответы Re: experience sharing: select query returns more records than necessary  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc



In contrast, if I issue the query on the DB server in the psql console, it
returns records almost immediately. Finally I found that it is because the
postgreSQL JDBC driver is pre-fetching a lot (all?) of the records. To fix
the problem, one can call setFetchSize(50) on the statement.

psql doesnt do anything any differently. It just doesn't have to create objects, and you are likely local to the network.

And yes, setFetchSize is the correct way to handle this.

Dave

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

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: JDBC exception, incompatible types in simple stored procedure.
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: experience sharing: select query returns more records than necessary