From: Josh Berkus <josh@agliodbs.com>
To: Chris Huston <chuston@bangjafwac.com>
To: pgsql-performance@postgresql.org
Subject: Re: Reading data in bulk - help?
Date: Tue, 9 Sep 2003 17:11:32 -0700
Message-ID: <200309091711.32275.josh@agliodbs.com> (raw)
In-Reply-To: <305D78CA-E320-11D7-A142-000393011B1A@bangjafwac.com>
References: <305D78CA-E320-11D7-A142-000393011B1A@bangjafwac.com>
Chris,
> I've got an application that needs to chunk through ~2GB of data. The
> data is ~7000 different sets of 300 records each. I put all of the data
> into a postgres database but that doesn't look like its going to work
> because of how the data lives on the disk.
Your problem is curable through 4 steps:
1) adjust your postgresql.conf to appropriate levels for memory usage.
2) if those sets of 300 are blocks in some contiguous order, then cluster them
to force their physical ordering on disk to be the same order you want to
read them in. This will require you to re-cluster whenever you change a
significant number of records, but from the sound of it that happens in
batches.
3) Get better disks, preferrably a RAID array, or just very fast scsi if the
database is small. If you're budget-constrained, Linux software raid (or
BSD raid) on IDE disks is cheap. What kind of RAID depends on what else
you'll be doing with the app; RAID 5 is better for read-only access, RAID 1+0
is better for read-write.
4) Make sure that you aren't dumping the data to the same disk postgreSQL
lives on! Preferably, make sure that your swap partition is on a different
disk/array from postgresql. If the computing app is complex and requires
disk reads aside from postgres data, you should make sure that it lives on
yet another disk. Or you can simplify this with a good, really large
multi-channel RAID array.
--
-Josh Berkus
Aglio Database Solutions
San Francisco
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-performance@postgresql.org
Cc: josh@agliodbs.com, chuston@bangjafwac.com
Subject: Re: Reading data in bulk - help?
In-Reply-To: <200309091711.32275.josh@agliodbs.com>
References: <305D78CA-E320-11D7-A142-000393011B1A@bangjafwac.com> <200309091711.32275.josh@agliodbs.com>
* 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