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 6E9885287F for ; Tue, 28 Jun 2005 10:13:15 -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 22278-09 for ; Tue, 28 Jun 2005 13:13:14 +0000 (GMT) Received: from weber.conzentrate.int (0x55513365.adsl.cybercity.dk [85.81.51.101]) by svr1.postgresql.org (Postfix) with ESMTP id DB8035286D for ; Tue, 28 Jun 2005 10:13:12 -0300 (ADT) Received: from [10.10.100.110] (helo=[10.10.100.110]) by weber.conzentrate.int with esmtp (Exim 4.43) id 1DnFth-0003FH-Fc for pgsql-jdbc@postgresql.org; Tue, 28 Jun 2005 15:13:05 +0200 Message-ID: <42C14CEA.4020704@conzentrate.com> Date: Tue, 28 Jun 2005 15:13:14 +0200 From: Jesper Thorhauge User-Agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: getBinaryStream and OutOfMemoryException References: <42C10723.5010702@conzentrate.com> <42C14B45.8000500@opencloud.com> In-Reply-To: <42C14B45.8000500@opencloud.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.24 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200506/140 X-Sequence-Number: 13102 Okay, thanks alot for the quick answer! I was wondering, do you know how much more efficient it could be done using the binary format you are mentioning? I'm especially interested in decreasing the amount of memory used to get large bytea values... /Jesper Oliver Jowett wrote: >Jesper Thorhauge wrote: > > >>Looking into the cvs >>checkout from >>22-05-2005, it really seems to me that getBinaryStream is nothing more >>than a >>getBytes ...?? >> >> > >Correct. The current frontend/backend protocol doesn't really let us do >this differently, at least for bytea columns. It could be made more >memory-efficient (e.g. by using the binary result format rather than the >current text format) but the driver still has to pull the entire column >value across the wire at the time the row is returned. > >Another approach would be to write large column values to disk, but >noone's written the code to do that yet; it also has some other problems >such as: what if you are running in an environment where you don't have >access to the disk? > >-O > >