From: Alex Paulusberger <alexp@meta-bit.com>
To: pgsql-admin@postgresql.org
Subject: Performance Problems
Date: Fri, 23 Aug 2002 22:31:50 +0900
Message-ID: <3D663946.4050008@meta-bit.com> (raw)
Hi,
i came across a problem for which I don't really have an explanation. If
anyone has some ideas, help would be greatly appreciated.
Here we go...
I run postgers 7.2.1 on a SunFire, 1 GB memory.
I run a perl batch job (DBI, same machine) that does the following.
1. Iterates through all the records in a table (total 4500 records) by
selecting one record at the time
2. The record then is used to select a couple of records from another
table (total 400,000 records in the table)
and then selects a couple of records (average 10-15), complements
the records with additional information
and stores the information in a temp table.
3. The temp table is then consulted, one record selected and then
inserted in a results table.
the results table is growing by 4,500 records a day. the temp table
is primarily used to apply a logic by sorting
records.
The process:
The whole process loops 4,500 times.
For every loop
- a temp table is cleared
- 10-15 records are inserted into the temp table
- one record is selected from the temp table and inserted into the
results table.
in-between some calculations are done in perl.
the total number of selects is ca. 400,000
total number of inserts of table deletes are 4,500
total number of inserts are ca. 400,000
The problem:
initially if am able to evaluate 5-6 records a second and insert them
into the results table, however towards the end
of the evaluation, the figure drops to under 2. I optimized the code,
use transaction blocks and tuned the database (has 700mb of memory
allocated to it). What I don't quite understand is why the system slows
down. since the process steps are the same. Could perl be the reason ?
Any ideas ?
Thanks
Alex
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-admin@postgresql.org
Cc: alexp@meta-bit.com
Subject: Re: Performance Problems
In-Reply-To: <3D663946.4050008@meta-bit.com>
References: <3D663946.4050008@meta-bit.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