Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 86FE39FC090 for ; Thu, 28 Jun 2007 05:16:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 18036-08 for ; Thu, 28 Jun 2007 05:16:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by postgresql.org (Postfix) with ESMTP id 35A249FC066 for ; Thu, 28 Jun 2007 05:16:39 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id k40so687792wah for ; Thu, 28 Jun 2007 01:16:33 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=m2MXXnFj2FAsRiuYlYh7t94RPDFApia/6IpNKfHP+99BG765O0U4rx+6SpqRZuTBsz7rK3GhdODP+aBCoDVlughPpcnSrv6qlttxsTwZ0ObM7G8QgCWJqk302rXJvtDI7XSmS7I5t68mC6DOJsINoLnBT1uagn2HK5V+XqInsE4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=TAwEqmcGgWGPMg6Xqny0JwUO6WBiYfCYvgJQS1bYEUPJiIrk43unVZ/QMnkAmLpMIeKS5PPTD8Glgl5JVl624CSiQiwe5zwxwSr8+6Ck0jsy2BLSM3M1GBNBczPQBuvCPO/tS96V39aXwH9NzSG/DxNncoocmVfRIlLWKdfEwxI= Received: by 10.115.61.1 with SMTP id o1mr1310088wak.1183018593585; Thu, 28 Jun 2007 01:16:33 -0700 (PDT) Received: from ?10.1.1.15? ( [203.217.18.65]) by mx.google.com with ESMTP id q18sm17664457pog.2007.06.28.01.16.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 28 Jun 2007 01:16:33 -0700 (PDT) Message-ID: <46836EC8.20807@gmail.com> Date: Thu, 28 Jun 2007 18:18:16 +1000 From: Chris User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Richard Huxton CC: Tom Lane , Pgsql performance Subject: Re: update query taking too long References: <46834124.5010600@gmail.com> <21072.1183009270@sss.pgh.pa.us> <46835252.5070901@gmail.com> <468357B2.1040205@archonet.com> <46835A16.3050602@gmail.com> <46835D14.6010507@archonet.com> In-Reply-To: <46835D14.6010507@archonet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/625 X-Sequence-Number: 25658 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/