From: Dave Cramer <pg@fastcrypt.com>
To: Waldomiro <wmiro@ig.com.br>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Large Tables
Date: Wed, 11 Aug 2004 09:30:18 -0400
Message-ID: <1092231018.1561.50.camel@localhost.localdomain> (raw)
In-Reply-To: <004601c47f9c$d882e820$1001a8c0@shx.com.br>
References: <004601c47f9c$d882e820$1001a8c0@shx.com.br>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: pg@fastcrypt.com, wmiro@ig.com.br
Subject: Re: Large Tables
In-Reply-To: <1092231018.1561.50.camel@localhost.localdomain>
References: <004601c47f9c$d882e820$1001a8c0@shx.com.br> <1092231018.1561.50.camel@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox