Re: update slow

From: Richard Huxton <dev(at)archonet(dot)com>
To: Josué Maldonado <josue(at)lamundial(dot)hn>, pgsql-general(at)postgresql(dot)org
Subject: Re: update slow
Date: 2003-11-11 20:13:02
Message-ID: 200311112013.02588.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 11 November 2003 19:46, Josué Maldonado wrote:
> 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.

Can you post EXPLAIN ANALYSE <query> on this shorter one - that will show what
PG is doing.

One thing that might be worth looking at is using PG's non-standard
UPDATE t1 SET c1=... FROM t2 ...

--
Richard Huxton
Archonet Ltd

In response to

  • update slow at 2003-11-11 19:46:48 from Josué Maldonado

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2003-11-11 20:38:53 Re: Proposal for a cascaded master-slave replication system
Previous Message Jan Wieck 2003-11-11 19:54:27 Re: Proposal for a cascaded master-slave replication system