Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 2F3439FC066 for ; Thu, 28 Jun 2007 03:19:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 66989-04 for ; Thu, 28 Jun 2007 03:19:15 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.225]) by postgresql.org (Postfix) with ESMTP id A8FD79FC04D for ; Thu, 28 Jun 2007 03:19:17 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id m22so193506nzf for ; Wed, 27 Jun 2007 23:19:16 -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=FEEEjH74hKh8uZatr+YXJIBcmoOKFPwW4q6i11ERmQxLcppWVcLmUMBO3B2ZHyveiSNQ4zU1N7VdcdZ/6jADgP8mvpefBL5GykDP9SVP3LjU8kYXyjoIB8igm9qW7oveTkOKuIw1bF8/G2XLLaPhl1AEbnf/EcqDkHelAdehA4Q= 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=qWf4OUhlA41zSuI/NtHNt/5H7Z5ITplR0JSipBJ+wTkwbCEEUHUqF+DYYOEQCNkeJIKkaLFshR/pErAsdN7zQn+rR+p9wYlwmUD8PSDS3MhKAhcr+mRXNpTME3k42fqWkcp82JaFIGYWCm2KHo51gAXcuBhyt1oRvFl7BfI5s14= Received: by 10.114.202.15 with SMTP id z15mr1207092waf.1183011555797; Wed, 27 Jun 2007 23:19:15 -0700 (PDT) Received: from ?10.1.1.15? ( [203.217.18.65]) by mx.google.com with ESMTP id m28sm15790628poh.2007.06.27.23.19.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 27 Jun 2007 23:19:15 -0700 (PDT) Message-ID: <4683534B.8060609@gmail.com> Date: Thu, 28 Jun 2007 16:20:59 +1000 From: Chris User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: "A. Kretschmer" CC: pgsql-performance@postgresql.org Subject: Re: update query taking too long References: <46834124.5010600@gmail.com> <20070628053724.GB22066@a-kretschmer.de> In-Reply-To: <20070628053724.GB22066@a-kretschmer.de> 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/613 X-Sequence-Number: 25646 A. Kretschmer wrote: > am Thu, dem 28.06.2007, um 15:03:32 +1000 mailte Chris folgendes: >> Hi all, >> >> I'm trying to do an update of a reasonably large table and it's taking >> way too long so I'm trying to work out why and if I need to tweak any >> settings to speed it up. >> >> The table is around 3.5 million records. >> >> The query is >> >> update table set domainname=substring(emailaddress from position('@' in >> emailaddress)); > > I think, this is a bad idea. > Because, first, you have 2 columns with nearly identical data > (mailaddres includes the domain and a extra domain field) Yeh I know. I might have to go back to the drawing board on this one. The app has to work in mysql & postgres so I'm a bit limited in some of my approaches. -- Postgresql & php tutorials http://www.designmagick.com/