pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrea Aime <andrea.aime@aliceposta.it>
To: Kris Jurka <books@ejurka.com>
Cc: Jack Orenstein <jao@geophile.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Queries with large ResultSets
Date: Thu, 20 May 2004 20:22:37 +0200
Message-ID: <200405202022.37646.andrea.aime@aliceposta.it> (raw)
In-Reply-To: <Pine.BSO.4.56.0405201057110.11233@leary.csoft.net>
References: <40ABD19C.8080109@geophile.com>
	<Pine.BSO.4.56.0405201057110.11233@leary.csoft.net>

Alle 18:01, giovedì 20 maggio 2004, Kris Jurka ha scritto:
> 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.

Ugh... those limitation are really frightening, this means we cannot fetch
big quantities of data outside of a transaction... this is a problem with 
application servers like GeoServer that keep a connection pool and 
need to fetch big quantities of data also outside a transaction... any hope
to see this fixed soon? Is it a driver problem or a server limitation?

Best regards
Andrea Aime



view thread (13+ messages)  latest in thread

Message-ID: <200405202022.37646.andrea.aime@aliceposta.it>
Permalink:  ../200405202022.37646.andrea.aime@aliceposta.it/
Also on:    postgresql.org/message-id/200405202022.37646.andrea.aime@aliceposta.it

 · 

reply

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: andrea.aime@aliceposta.it, books@ejurka.com, jao@geophile.com
  Subject: Re: Queries with large ResultSets
  In-Reply-To: <200405202022.37646.andrea.aime@aliceposta.it>
  References: <40ABD19C.8080109@geophile.com> <Pine.BSO.4.56.0405201057110.11233@leary.csoft.net> <200405202022.37646.andrea.aime@aliceposta.it>

* 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