update slow - Mailing list pgsql-general

From Josué Maldonado
Subject update slow
Date
Msg-id 3FB13CA8.40005@lamundial.hn
Whole thread Raw
Responses Re: update slow  (Richard Huxton <dev@archonet.com>)
List pgsql-general
Hello list,

I have 7.3.4 on RH 8, server hardware is a dual processor Intel Xeon 2.4
Ghz, 2G RAM, 27Gb HD available on postgres partition.

Table cost2est2003 with 99350 recs is described as:
code char(4)    -- index
tcos numeric(12,4)
mes char(6) -- index

Table estprod with 355513 recs is described as:
pk_estprod  -- index
epr_periodo char(6)  -- Index
epr_venta numeric(12,4)
epr_costo numeric(12,4)
pro_code char(4)


This is the update command:
update estprod set epr_costo=(select tcos from cost2est2003 where
code=pro_code and mes=epr_periodo) where epr_periodo >='200301'

The above filters the records to affect only 99157 rows, the update
takes hours and don't get done (I did cancel it), I changed the filter
to "epr_periodo ='200301'" to update only 9756 rows but still has more
than 10 minutes working.

I wonder if there is something I'm doing wrong, any help will be
appreciated. BTW the server is not in production is not doing anything
else. Thanks in advance



--
Josué Maldonado.



pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: PL/Perl returning multiple rows
Next
From: Jan Wieck
Date:
Subject: Re: Proposal for a cascaded master-slave replication system