Re: ResultSet memory usage - Mailing list pgsql-jdbc

From Nick Fankhauser
Subject Re: ResultSet memory usage
Date
Msg-id NEBBLAAHGLEEPCGOBHDGKEODECAA.nickf@ontko.com
Whole thread Raw
In response to ResultSet memory usage  (Timo Savola <timo.savola@codeonline.com>)
Responses Re: ResultSet memory usage
List pgsql-jdbc
Timo-

A possible workaround- If you only need to grab a few rows is there some way
to make those rows float to the top using an "order by" & then apply "limit"
so you don't have to deal with the huge ResultSet?

-Nick



> -----Original Message-----
> From: pgsql-jdbc-owner@postgresql.org
> [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Timo Savola
> Sent: Friday, January 11, 2002 6:42 AM
> To: pgsql-jdbc@postgresql.org
> Subject: [JDBC] ResultSet memory usage
>
>
> Hi. I'm new to this list, so please be gentle.
>
> I've been using PostgreSQL with a Java application that needs to SELECT
> (without LIMIT) from a table with a lot or rows. I tested the
> application when the table in question had over 2 million rows, and the
> JVM kept running out of memory (of course I could tune the heap size
> settings). I don't actually need all the 2 million rows; the application
> logic selects some of the first rows (in a manner that I couldn't
> implement in the SQL query) and then stops reading the ResultSet.
>
> I checked the code of the JDBC driver. As far as I can understand
> org/postgresql/jdbc2/ResultSet.java, the whole result set is read into
> memory at once. Is there any practical way to tune the driver to read
> the rows a little at a time? Any plans to enhance the driver to do that?
> Would it be a big job to write such a patch without prior knowledge of
> the internals of PostgreSQL?
>
> Timo
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>


pgsql-jdbc by date:

Previous
From: "Dave Cramer"
Date:
Subject: Re: ResultSet memory usage
Next
From: Kovács Péter
Date:
Subject: Proposal for a configurable ResultSet implementation