From: Oliver Jowett <oliver@opencloud.com>
To: Andy Zeneski <jaz@ofbiz.org>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Result Set Cursor Patch
Date: Sat, 01 May 2004 11:01:53 +1200
Message-ID: <4092DAE1.5020500@opencloud.com> (raw)
In-Reply-To: <164902F2-9AE8-11D8-A094-000A95DA1A7C@ofbiz.org>
References: <AC8D227A-9AB7-11D8-A094-000A95DA1A7C@ofbiz.org>
<Pine.BSO.4.56.0404301035120.23452@leary.csoft.net>
<B3BDBEB6-9ABF-11D8-A094-000A95DA1A7C@ofbiz.org>
<Pine.BSO.4.56.0404301115170.23452@leary.csoft.net>
<CDF53B82-9AC2-11D8-A094-000A95DA1A7C@ofbiz.org>
<Pine.BSO.4.56.0404301128280.15995@leary.csoft.net>
<AC9E43EA-9AC7-11D8-A094-000A95DA1A7C@ofbiz.org>
<164902F2-9AE8-11D8-A094-000A95DA1A7C@ofbiz.org>
Andy Zeneski wrote:
> Please let me know if there is anything else which would prevent this
> from getting into CVS. Also, if all is good, could you please let me
> know when has been committed so I can update my local tree.
A few comments from looking at the patch..
resultSetSize() does a number of FETCH ABSOLUTEs, throwing away the
results, and then backtracking when it reaches a row that doesn't exist.
A better strategy might be to use MOVE FORWARD ALL and examine the
rowcount in the returned command tag.
fetchAbsolute() and things that end up calling it doesn't seem to
respect the fetchsize, i.e. you always end up with a single-row
resultset in memory. How about executing "MOVE ABSOLUTE n; FETCH FORWARD
fetchsize" instead of just "FETCH ABSOLUTE n"?
How does the performance of iterating backwards through a resultset
compare with the non-cursor case or the forward iteration case? It seems
like with the patch it will end up doing a FETCH ABSOLUTE of a single
row on each iteration. Really fetchAbsolute needs to do either a "MOVE
ABSOLUTE n; FETCH FORWARD fetchsize" or "MOVE ABSOLUTE n; FETCH BACKWARD
fetchsize" depending on the resultset's preferred fetch direction (see
setFetchDirection)
I have a number of code style comments too, let me know if you'd like
the gory details :)
-O
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: oliver@opencloud.com, jaz@ofbiz.org
Subject: Re: Result Set Cursor Patch
In-Reply-To: <4092DAE1.5020500@opencloud.com>
References: <AC8D227A-9AB7-11D8-A094-000A95DA1A7C@ofbiz.org> <Pine.BSO.4.56.0404301035120.23452@leary.csoft.net> <B3BDBEB6-9ABF-11D8-A094-000A95DA1A7C@ofbiz.org> <Pine.BSO.4.56.0404301115170.23452@leary.csoft.net> <CDF53B82-9AC2-11D8-A094-000A95DA1A7C@ofbiz.org> <Pine.BSO.4.56.0404301128280.15995@leary.csoft.net> <AC9E43EA-9AC7-11D8-A094-000A95DA1A7C@ofbiz.org> <164902F2-9AE8-11D8-A094-000A95DA1A7C@ofbiz.org> <4092DAE1.5020500@opencloud.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