Re: Re: JDBC Performance

From: Peter Mount <peter(at)retep(dot)org(dot)uk>
To: Gunnar R|nning <gunnar(at)candleweb(dot)no>
Cc: kientzle(at)acm(dot)org, PostgreSQL general mailing list <pgsql-general(at)postgresql(dot)org>, "Keith L(dot) Musser" <kmusser(at)idisys(dot)com>
Subject: Re: Re: JDBC Performance
Date: 2000-10-03 11:06:19
Message-ID: Pine.LNX.4.21.0010031158450.420-100000@maidast.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2 Oct 2000, Gunnar R|nning wrote:

> Peter Mount <peter(at)retep(dot)org(dot)uk> writes:
>
> >
> > For JDBC2, I'm planning (may get done for 7.1) an alternate ResultSet
> > class that uses cursors. This would speed things up as the entire
> > resultset isn't received in one go. That's the biggest bottleneck of them
> > all.
> >
>
> I would think this depends on the queries you execute. Is it any overhead on
> the backend side related to retrieving results through the use of
> cursors(ignoring the extra bytes sent) ?

Which is why it's an alternate class, not a replacement. The existing one
is for general use, but you can define the cursor name, so if you do for a
particular Statement object, then the ResultSet's from it would use that
cursor.

> If you only use a fragment of the data in the result set this method would
> of course be faster, but in other situations I'm concerned that you will
> only add overhead to the ResulSet.next() method(with familiy). But you
> mentioned alternate implementation, so that would probably mean that the
> user can choose the appropriate implementation for his application ?

Yes. The related methods are:

Statement.setCursorName(String name)
Statement.setFetchDirection(int direction)
Statement.setFetchSize(int rows)

The Statement.getResultSetType() method returns TYPE_FORWARD_ONLY for the
existing class, and TYPE_SCROLL_INSENSITIVE for the new one.

Peter

--
Peter T Mount peter(at)retep(dot)org(dot)uk http://www.retep.org.uk
PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
Java PDF Generator http://www.retep.org.uk/pdf/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Mount 2000-10-03 11:07:34 Re: Re: JDBC Performance
Previous Message Peter Mount 2000-10-03 10:57:37 Re: Re: JDBC Performance