Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XVbEh-0003Fg-Iw for pgsql-jdbc@arkaria.postgresql.org; Sun, 21 Sep 2014 07:07:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XVbEg-0003BG-L9 for pgsql-jdbc@arkaria.postgresql.org; Sun, 21 Sep 2014 07:07:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XVbEf-0003B9-I4 for pgsql-jdbc@postgresql.org; Sun, 21 Sep 2014 07:07:05 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XVbEb-0001Am-Kd for pgsql-jdbc@postgresql.org; Sun, 21 Sep 2014 07:07:03 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XVbEY-0002a3-2L for pgsql-jdbc@postgresql.org; Sun, 21 Sep 2014 09:06:58 +0200 Received: from ppp-188-174-49-232.dynamic.mnet-online.de ([188.174.49.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Sep 2014 09:06:58 +0200 Received: from spam_eater by ppp-188-174-49-232.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Sep 2014 09:06:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: Disk buffering of resultsets Date: Sun, 21 Sep 2014 09:06:44 +0200 Lines: 31 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-188-174-49-232.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: X-Pg-Spam-Score: -3.4 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Enrico Olivelli - Diennea wrote on 19.09.2014 12:44: > Hi, > > we are moving from Oracle to PostgreSQL and we hit a serious > problem. > > When executing a query with a large result set your driver loads each > record in memory and this is a blocking problem for us. > > The work-around is to use server-side cursors > (http://jdbc.postgresql.org/documentation/head/query.html) but in > order to do this we have to change autocommit mode of the transaction > and this will change transaction semantics of out code. > > Many JDBC drivers provide some swap-to-disk function in oredr to deal > with huge result sets > > Something like “if we are loading in RAM more than X MBs than swap on > disk” > > or “if we are loading in RAM more than X rows than swap on disk” > (more simple to implement) > Wouldn't it make more sense to allow for a non-buffered result when using auto-commit (something like "bufferResults=false") instead? Or is that technically not possible due to the Postgres wire-protocol? Thomas -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc