Re: update query taking too long - Mailing list pgsql-performance

From Chris
Subject Re: update query taking too long
Date
Msg-id 46836EC8.20807@gmail.com
Whole thread Raw
In response to Re: update query taking too long  (Richard Huxton <dev@archonet.com>)
Responses Re: update query taking too long
List pgsql-performance
Richard Huxton wrote:
> Chris wrote:
>> db=# UPDATE email_upd_test SET domainname=substring(email from
>> position('@' in email));
>> UPDATE 1000000
>> Time: 43796.030 ms
>>
>> I think I'm I/O bound from my very limited understanding of vmstat.
>
> Well, 43 seconds to update 1 million rows suggests your real query
> should be complete in a few minutes, even if your real table has more
> columns.

Yep.

I think I have solved it though - the server was checkpointing so much
not much else was going on.

I didn't have logging set up before but it's up and running now and I
was getting

LOG:  checkpoints are occurring too frequently (26 seconds apart)
HINT:  Consider increasing the configuration parameter
"checkpoint_segments".

So I increased that from 10 to 30 and it finished:

UPDATE 3500101
Time: 146513.349 ms

Thanks for all the help :)

--
Postgresql & php tutorials
http://www.designmagick.com/

pgsql-performance by date:

Previous
From: Richard Huxton
Date:
Subject: Re: PostgreSQL 8.0 occasionally slow down
Next
From: "Ho Fat Tsang"
Date:
Subject: Re: PostgreSQL 8.0 occasionally slow down