Re: scrollable result sets performance problems - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: scrollable result sets performance problems
Date
Msg-id Pine.BSO.4.64.0704120344040.10990@leary.csoft.net
Whole thread Raw
In response to scrollable result sets performance problems  ("Radim Kolar SF.NET" <hsn@sendmail.cz>)
List pgsql-jdbc

On Wed, 11 Apr 2007, Radim Kolar SF.NET wrote:

> I have performance problems with scrollable result sets, it looks like
> all rows are fetched despite ResultSet.setFetchSize(). its major
> problem with sets about 11m rows in size and query execution takes a long
> time, so limit/offset can not be used..

As noted in the documentation [1] the driver won't respect the fetch size
unless the ResultSet is TYPE_FORWARD_ONLY so it doesn't work for
scrollable results.

The only real workaround would be to create a scrollable cursor yourself
and issue the appropriate move and fetch commands to make it do what you
want.

Someone started to implement the functionality in the driver, but they
never finished it. [2]

Kris Jurka

[1] http://jdbc.postgresql.org/documentation/82/query.html#query-with-cursor
[2] http://archives.postgresql.org/pgsql-jdbc/2004-05/msg00164.php

pgsql-jdbc by date:

Previous
From: "Radim Kolar SF.NET"
Date:
Subject: scrollable result sets performance problems
Next
From: Heikki Linnakangas
Date:
Subject: Re: 7.4 driver vs 8.2 driver