Re: scrollable result sets performance problems

From: Kris Jurka <books(at)ejurka(dot)com>
To: "Radim Kolar SF(dot)NET" <hsn(at)sendmail(dot)cz>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: scrollable result sets performance problems
Date: 2007-04-12 07:49:55
Message-ID: Pine.BSO.4.64.0704120344040.10990@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Heikki Linnakangas 2007-04-12 08:03:19 Re: 7.4 driver vs 8.2 driver
Previous Message Kris Jurka 2007-04-11 17:41:40 Re: random escape function