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 2660114B2820 for ; Wed, 11 Aug 2004 10:29:23 -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 87086-07 for ; Wed, 11 Aug 2004 13:29:12 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 8474A14B280B for ; Wed, 11 Aug 2004 10:29:06 -0300 (ADT) Received: (qmail 19641 invoked from network); 11 Aug 2004 13:29:06 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 11 Aug 2004 13:29:06 -0000 Subject: Re: Large Tables From: Dave Cramer Reply-To: pg@fastcrypt.com To: Waldomiro Cc: "pgsql-jdbc@postgresql.org" In-Reply-To: <004601c47f9c$d882e820$1001a8c0@shx.com.br> References: <004601c47f9c$d882e820$1001a8c0@shx.com.br> Content-Type: text/plain; charset=ISO-8859-1 Organization: Cramer Consulting Message-Id: <1092231018.1561.50.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 11 Aug 2004 09:30:18 -0400 Content-Transfer-Encoding: 8bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/77 X-Sequence-Number: 10799 This is sort of the wrong list, but I'll address jdbc specific issues with large tables. First of all, there are postgres databases with terabytes of data, so large tables are not an issue. Now you need to be aware that if you do a select * from large table without cursors, then the server will return the entire result set at once. This means that the driver will try to build the result set with 1 million rows, and chances are you will get an out of memory exception. So, you will have to use setFetchSize() to allow the driver to fetch the data in smaller chunks, or use cursors explicitly. Additionally, the driver will only use cursors internally if you turn auto commit off. This is an artifact of the way cursors work in pg. They are only updateable within a transaction. Dave On Wed, 2004-08-11 at 08:15, Waldomiro wrote: > Hi, > > It's my first time working with PostgreSql, so I have some doubts. > > My application is working very fine, but I have few records in my > tables. > > I need to build a table which I know will have more than 1 milion of > records. > > I'm afraid if It will work, I mean the indexes will not get corrupted > ? > > Or maybe it can get slower when every computer is reading the table ? > > I supose someone has already worked with large tables. > > How is It ? > > There is something I would know ? because I don't want to have > surprises. > > Your sugestions will be very useful. > > Thank you. > > SHX INFORMÁTICA LTDA. > Waldomiro Caraiani > Desenvolvimento de Produto > + 55 11 5581 1551 > wmiro@shx.com.br > www.shx.com.br -- Dave Cramer 519 939 0336 ICQ # 14675561