Re: Queries with large ResultSets - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Queries with large ResultSets
Date
Msg-id Pine.BSO.4.56.0405201057110.11233@leary.csoft.net
Whole thread Raw
In response to Queries with large ResultSets  (Jack Orenstein <jao@geophile.com>)
Responses Re: Queries with large ResultSets
List pgsql-jdbc

On Wed, 19 May 2004, 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?
>

Yes, in the 7.3 driver.  The 7.4 driver (which works quite well against a
7.3 database) will use a cursor based fetch to retrieve a chunk of rows at
a time.  There are a number of restrictions required to be able to use
this method (It only works with autocommit off and FORWARD_ONLY result
sets).  To enable this use Statement.setFetchSize to indicate how many
rows at a time you want retrieved.  Also there is a patch to the 7.5
driver to be able to retrieve subsets of the resultset for the scrollable
variety and hopefully I should get that in soon.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Queries with large ResultSets
Next
From: Andrea Aime
Date:
Subject: Re: Queries with large ResultSets