From: Jack Orenstein <jao@geophile.com>
To: psql-jdbc@postgresql.org
Subject: Queries with large ResultSets
Date: Wed, 19 May 2004 17:29:00 -0400
Message-ID: <40ABD19C.8080109@geophile.com> (raw)
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?
If so, this isn't very good for processing large ResultSets. The only
other open-source driver I could find is jxDBCon
(http://jxdbcon.sourceforge.net). Does anyone here have experience
with it?
One obvious application-level workaround is to add ORDER BY <primary
key> and LIMIT to the query, retrieve batches, keeping track of the
last primary key value, etc. That has lots of problems -- changing the
results of the overall scan (since each query runs at a different
time), and doing an index scan instead of a seq scan.
I'm considering modifying the driver, but that would put me behind on
my development schedule.
Jack Orenstein
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: jao@geophile.com, psql-jdbc@postgresql.org
Subject: Re: Queries with large ResultSets
In-Reply-To: <40ABD19C.8080109@geophile.com>
References: <40ABD19C.8080109@geophile.com>
* 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