X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 8B1929DCB38 for ; Thu, 5 Jan 2006 08:15:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67884-02 for ; Thu, 5 Jan 2006 08:15:25 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mosaic02.mosaic.de (mosaic02.mosaic.de [195.247.16.18]) by postgresql.org (Postfix) with ESMTP id 894139DCB32 for ; Thu, 5 Jan 2006 08:15:18 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mosaic02.mosaic.de (Postfix) with ESMTP id 11FF3778F0; Thu, 5 Jan 2006 13:16:41 +0100 (CET) Received: from mosaic02.mosaic.de ([127.0.0.1]) by localhost (mosaic02.mosaic-ag.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 32093-08; Thu, 5 Jan 2006 13:16:39 +0100 (CET) Received: from mailproxy.mosaic.de (proxy01.mosaic.de [172.17.201.1]) by mosaic02.mosaic.de (Postfix) with ESMTP id D2A96778B1; Thu, 5 Jan 2006 13:16:39 +0100 (CET) Received: by mailproxy.mosaic.de (Postfix, from userid 10000) id B31253A711; Thu, 5 Jan 2006 13:15:19 +0100 (CET) Received: from enterprise.mosaic-ag.com (enterprise.mosaic-ag.com [172.17.4.21]) by mailproxy.mosaic.de (Postfix) with ESMTP id 9E8FE3A6D6; Thu, 5 Jan 2006 13:15:19 +0100 (CET) Received: from aupc287.mosaic-ag.com ([172.17.1.87]) by enterprise.mosaic-ag.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 5 Jan 2006 13:13:14 +0100 To: "Khaldoun Ateyeh" Cc: Subject: Re: table full scan References: <0BD53BBFEDA6B240851F0B40DC7992E7180812@S007DCDE.panoratio.local> From: Roland Walter Date: Thu, 05 Jan 2006 13:15:17 +0100 In-Reply-To: <0BD53BBFEDA6B240851F0B40DC7992E7180812@S007DCDE.panoratio.local> (Khaldoun Ateyeh's message of "Thu, 5 Jan 2006 10:32:28 +0100") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, cygwin32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-OriginalArrivalTime: 05 Jan 2006 12:13:14.0343 (UTC) FILETIME=[673C3F70:01C611F1] X-Virus-Scanned: mosaic-ag.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200601/5 X-Sequence-Number: 14456 "Khaldoun Ateyeh" writes: > Hi, > I am using jdbc to full scan a huge table (over 11 million records). > Unfortunately, I get an OutOfMemoryError exception. Is there any way to > tell postgre not to try to load the whole table at once? > Set autocommit to false, then use the method setFetchSize() of the Statement to set the maximal rows that are read into the memory. For example: con.setAutoCommit(false); stmt = con.createStatement(); stmt.setFetchSize(1000); -- Roland Walter mailto: rwa (at) mosaic-ag (dot) com MOSAIC SOFTWARE AG phone: +49 (0) 22 25 / 88 2-41 1 Am Pannacker 3 fax: +49 (0) 22 25 / 88 2-20 1 D-53340 Meckenheim http://www.mosaic-ag.com Die in dieser E-Mail enthaltenen Nachrichten und Anhaenge sind ausschliesslich fuer den bezeichneten Adressaten bestimmt. Sie koennen rechtlich geschuetzte, vertrauliche Informationen enthalten. Falls Sie nicht der bezeichnete Empfaenger oder zum Empfang dieser E-Mail nicht berechtigt sind, ist die Verwendung, Vervielfaeltigung oder Weitergabe von Nachrichten und Anhaengen untersagt. Falls Sie diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte unverzueglich den Absender und vernichten Sie die E-Mail. This e-mail message and any attachment are intended exclusively for the named addressee. They may contain confidential information which may also be protected by professional secrecy. Unless you are the named addressee (or authorised to receive for the addressee) you may not copy or use this message or any attachment or disclose the contents to anyone else. If this e-mail was sent to you by mistake please notify the sender immediately and delete this e-mail.