Re: Queries with large ResultSets

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Queries with large ResultSets
Дата
Msg-id 40AC3A32.40000@opencloud.com
обсуждение исходный текст
Ответ на Queries with large ResultSets  (Jack Orenstein <jao@geophile.com>)
Список pgsql-jdbc
Jack Orenstein wrote:
> If I'm reading the source code correctly, the PostgreSQL 7.3.4 JDBC
> driver creates a ResultSet by evaluating the entire query, and putting
> all the rows into a Vector. ResultSet.next() iterates over the
> Vector. Is that in fact what is happening?

That's probably true for the 7.3.4 driver, which is quite old now.

The latest 7.4 drivers (which will work against a 7.3 server) will use a 
cursor to fetch the resultset incrementally when:
 - the statement fetchsize is non-zero; and - autocommit is off (and - the statement is TYPE_FORWARD_ONLY; and - the
queryis a single SELECT
 

There's also been a patch posted recently (check the archives) that 
allows use of cursors with scrollable resultsets.

-O


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

Предыдущее
От: Jack Orenstein
Дата:
Сообщение: Queries with large ResultSets
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Queries with large ResultSets