Context:
Pentium PIII, 128 MB RAM, 5400 RPM HD-10GB (of which 1.8 GB as swap
disk)
Debian linux testing, Postgresql 7.4.2 from the deb box.
Beginner with Postgresql but not with linux
At office, I'm on the verge of receiving (fragmented in text format
files) the readings of electricity load at each quarter of hour of
1,800 recorders for a couple of years. In a nutshell It means to store
and retrieve for study 1,800 * 365 *2 = 1,314,000 records exactly,
each made at least of the 96 readings + id-recorder +date.
After having convinced my IT-Dept morbidly prone to Micro$oft to
install in our lan an old PC doomed to perish with debian and
postgresql, I built on it a fake db, similar to that with which I'm
going to work, to have a go with PG and "taste" it. To be on the safe
side, you know.....
The db is made of 2 tables one as I told before and the other with all
the information on each recorder such as location, date of
installation, precision, etc. linked to the previous, cumbersome
table, the one made of 1,340,000 recs, each of which is composed by a
date field, an int4 as recorder code and 96 decimal field of 6 figure
after the point for the readings. By and large the db is 3.8 GB.
I'm astonished by the fact that, in spite of the poor hardware, a:
select sum(field1), avg(field2) from db;
takes roughly 5 min. only to be executed (mean of 20 trials always
changing the fields), leaving - in the process - 2.5 MB (out of 128
MB) of memory free and a mere 4 MB of the 1.8 GB of the swap area
occupied.
Nonetheless I'm asking your most revered help to try to improve
"dramatical ly" this performance.
Is there any action I could take to improve the performance of this
specific db?
Vittorio
Pentium PIII, 128 MB RAM, 5400 RPM HD-10GB (of which 1.8 GB as swap
disk)
Debian linux testing, Postgresql 7.4.2 from the deb box.
Beginner with Postgresql but not with linux
At office, I'm on the verge of receiving (fragmented in text format
files) the readings of electricity load at each quarter of hour of
1,800 recorders for a couple of years. In a nutshell It means to store
and retrieve for study 1,800 * 365 *2 = 1,314,000 records exactly,
each made at least of the 96 readings + id-recorder +date.
After having convinced my IT-Dept morbidly prone to Micro$oft to
install in our lan an old PC doomed to perish with debian and
postgresql, I built on it a fake db, similar to that with which I'm
going to work, to have a go with PG and "taste" it. To be on the safe
side, you know.....
The db is made of 2 tables one as I told before and the other with all
the information on each recorder such as location, date of
installation, precision, etc. linked to the previous, cumbersome
table, the one made of 1,340,000 recs, each of which is composed by a
date field, an int4 as recorder code and 96 decimal field of 6 figure
after the point for the readings. By and large the db is 3.8 GB.
I'm astonished by the fact that, in spite of the poor hardware, a:
select sum(field1), avg(field2) from db;
takes roughly 5 min. only to be executed (mean of 20 trials always
changing the fields), leaving - in the process - 2.5 MB (out of 128
MB) of memory free and a mere 4 MB of the 1.8 GB of the swap area
occupied.
Nonetheless I'm asking your most revered help to try to improve
"dramatical ly" this performance.
Is there any action I could take to improve the performance of this
specific db?
Vittorio
Comment