Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 3AA9F9FA0CF for ; Fri, 19 Oct 2007 12:53:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 37383-04 for ; Fri, 19 Oct 2007 12:53:00 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.241]) by postgresql.org (Postfix) with ESMTP id 0C82A9FA0C8 for ; Fri, 19 Oct 2007 12:53:00 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id b33so97942ana for ; Fri, 19 Oct 2007 08:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=MdS8cs74aBZDAnTsyjgTf0OUVfUH7b9M+B6NwJKD+nQ=; b=g2KOxFFMNUkye+UThj+iRYjX0d2WNAJzcGEOFJRmguFhVgOn+4XZT2rIiryO8x2aEmp+brRed6gB/Gjb9iBwdwyF2Rs0Vl3cEzCviLp+SvCwGW613ub5k+4F6Tihzpyr3e9riHO07TPrFIyjpfX6rGuS7aB2bpo7TEeYfsawkjw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qEG8/aRfqn65zMuJvn5+msRQu/lmb1+XaPNTctVUIop1dSbq87Bphqnsk3OQGeEr0x8mdTYxx9qCch7ZqQNl5VeOY+0QshhjUq8GELxgEIklVfjLPfcLkay54+r+UzWQqlmQQGdVdjY4Ziep2BzzB/6H1krEgaL0mSXaONiQvSk= Received: by 10.142.84.3 with SMTP id h3mr722837wfb.1192809178603; Fri, 19 Oct 2007 08:52:58 -0700 (PDT) Received: by 10.143.8.5 with HTTP; Fri, 19 Oct 2007 08:52:58 -0700 (PDT) Message-ID: <36e682920710190852r91139d3ge07093f791477fa8@mail.gmail.com> Date: Fri, 19 Oct 2007 11:52:58 -0400 From: "Jonah H. Harris" To: "Pavel Velikhov" Subject: Re: need help with a query Cc: pgsql-performance@postgresql.org In-Reply-To: <878599.37701.qm@web56406.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <878599.37701.qm@web56406.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/231 X-Sequence-Number: 27253 On 10/19/07, Pavel Velikhov wrote: > > Hi, > > I am updating a big table (90M records) with data from another rather > large table (4M entries). Here is my update query: > > update links set target_size = > ( select size from articles where articles.article_id = > links.article_to) try: UPDATE links SET target_size = size FROM articles WHERE articles.article_id = links.article_to; -- Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324 EnterpriseDB Corporation | fax: 732.331.1301 499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com Edison, NJ 08837 | http://www.enterprisedb.com/