update slow

Поиск
Список
Период
Сортировка
От Josué Maldonado
Тема update slow
Дата
Msg-id 3FB13CA8.40005@lamundial.hn
обсуждение исходный текст
Ответы Re: update slow
Список 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 по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: PL/Perl returning multiple rows
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Proposal for a cascaded master-slave replication system