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 754F8D1E153 for ; Wed, 12 May 2004 07:57:15 -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 17716-02 for ; Wed, 12 May 2004 07:56:57 -0300 (ADT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 26A00D1DD0E for ; Wed, 12 May 2004 07:56:54 -0300 (ADT) Received: (qmail 28009 invoked from network); 12 May 2004 10:56:55 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 12 May 2004 10:56:55 -0000 Subject: Re: JDBC and processing large numbers of rows From: Dave Cramer Reply-To: pg@fastcrypt.com To: Guido Fiala Cc: "pgsql-jdbc@postgresql.org" In-Reply-To: <200405120837.42865.guido.fiala@dka-gmbh.de> References: <20040511103520.1ADC6D1B1EE@svr1.postgresql.org> <03f401c437b6$1bb615b0$3201a8c0@rasta> <40A17610.7040600@earthlink.net> <200405120837.42865.guido.fiala@dka-gmbh.de> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1084359414.1536.149.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 12 May 2004 06:56:54 -0400 Content-Transfer-Encoding: 7bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/75 X-Sequence-Number: 10085 Guido, No, this isn't the case, if you use cursors inside a transaction then you will be able to have an arbitrarily large cursor open ( of any size AFAIK ) --dc-- On Wed, 2004-05-12 at 02:37, Guido Fiala wrote: > Reading all this i'd like to know if all this isn't just a tradeof between > _where_ the memory is consumed? > > If your JDBC-client holds all in memory - it gets an OutOfMem-Exception. > > If your backend uses Cursors - it caches the whole resultset and probably > starts swapping and gets slow (needs the memory of all users). > > If you use Limit and Offset the database has to do more to find the > data-snippet and in worst case (last few records) still needs temporary the > whole resultset? (not sure here) > > Is that just a "choose your poison" ? At least in the first case the memory of > the Client _gets_ used too and not all load to the backend, on the other side > - most the the user does not really read all the data at all, so it puts > unnecessary load on all the hardware. > > Really like to know what the best way to go is then... > > Guido > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > > > > !DSPAM:40a1c98a223941159885930! > > -- Dave Cramer 519 939 0336 ICQ # 14675561