Re: update slow - Mailing list pgsql-general

From Richard Huxton
Subject Re: update slow
Date
Msg-id 200311112013.02588.dev@archonet.com
Whole thread Raw
In response to update slow  (Josué Maldonado <josue@lamundial.hn>)
Responses Re: update slow  (Josué Maldonado <josue@lamundial.hn>)
List 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

pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Proposal for a cascaded master-slave replication system
Next
From: Josué Maldonado
Date:
Subject: Re: update slow