X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id AA784D1E7A8 for ; Fri, 30 Apr 2004 20:02:30 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 86859-06 for ; Fri, 30 Apr 2004 20:02:12 -0300 (ADT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 5F0DAD1E72D for ; Fri, 30 Apr 2004 20:02:08 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1BJh12-0004WH-00; Sat, 01 May 2004 11:01:56 +1200 Message-ID: <4092DAE1.5020500@opencloud.com> Date: Sat, 01 May 2004 11:01:53 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andy Zeneski Cc: pgsql-jdbc@postgresql.org Subject: Re: Result Set Cursor Patch References: <164902F2-9AE8-11D8-A094-000A95DA1A7C@ofbiz.org> In-Reply-To: <164902F2-9AE8-11D8-A094-000A95DA1A7C@ofbiz.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200404/276 X-Sequence-Number: 10006 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