pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Chris <dmagick@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pgsql performance <pgsql-performance@postgresql.org>
Subject: Re: update query taking too long
Date: Thu, 28 Jun 2007 08:02:44 +0100
Message-ID: <46835D14.6010507@archonet.com> (raw)
In-Reply-To: <46835A16.3050602@gmail.com>
References: <46834124.5010600@gmail.com>
	<21072.1183009270@sss.pgh.pa.us>
	<46835252.5070901@gmail.com>
	<468357B2.1040205@archonet.com>
	<46835A16.3050602@gmail.com>

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



view thread (14+ messages)  latest in thread

Message-ID: <46835D14.6010507@archonet.com>
Permalink:  ../46835D14.6010507@archonet.com/
Also on:    postgresql.org/message-id/46835D14.6010507@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: dev@archonet.com, dmagick@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: update query taking too long
  In-Reply-To: <46835D14.6010507@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox