X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1C56E52A00 for ; Tue, 19 Jul 2005 20:08:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90511-10 for ; Tue, 19 Jul 2005 23:08:29 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 4B2D4529E9 for ; Tue, 19 Jul 2005 20:08:28 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Dv1CR-0000dL-79; Wed, 20 Jul 2005 11:08:31 +1200 Message-ID: <42DD87EE.8090703@opencloud.com> Date: Wed, 20 Jul 2005 11:08:30 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Grittner Cc: pgsql-jdbc@postgresql.org Subject: Re: Streaming ResultSet References: In-Reply-To: X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/148 X-Sequence-Number: 13296 Kevin Grittner wrote: > I'm curious about the reasons that this appoach was taken -- why not > return the rows as they are retrieved from the server? The short answer is because to stream on the fly is a much more complex approach and no-one has stepped forward to implement it. > (1) It might not be easy to create all of the right conditions for the > cursored approach to work. Another solution here is to work on making the cursor support code more flexible. Again the main reason that this is not done is that no-one has come up with a robust implementation yet. > (2) You might think you've met all the conditions for the cursored > approach and be wrong. The default behavior might kick in and cause an > OutOfMemoryError. The same is true with a streaming approach. The driver likes to issue its own queries internally in many places; if you happen to trip up on one of those while processing your resultset, boom! Your best bet to see this implemented is to implement it yourself and send us a patch. It's a fairly large chunk of work with debatable benefit, and personally I'd rather spend the time on better cursor support. (if I *had* time!) -O