Re: update query taking too long

From: Richard Huxton <dev(at)archonet(dot)com>
To: Chris <dmagick(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pgsql performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: update query taking too long
Date: 2007-06-28 07:02:44
Message-ID: 46835D14.6010507@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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.

Could you check again and just make sure you don't have a foreign key
referencing this table? I suspect a large table without an index on the
referencing column.

If you can't see anything, cancel the long-running query, run VACUUM
FULL VERBOSE on the table, ANALYSE VERBOSE and then try it again.
There's something very odd here.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Richard Huxton 2007-06-28 07:17:38 Re: High IOWAIT times, low iops? Need Help with configuration
Previous Message Ho Fat Tsang 2007-06-28 06:54:31 PostgreSQL 8.0 occasionally slow down