Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 3430ADE314D for ; Tue, 3 Apr 2012 14:39:35 -0300 (ADT) Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SF7he-00024Z-58 for pgsql-performance@postgresql.org; Tue, 03 Apr 2012 17:39:34 +0000 X-Originating-IP: 217.70.178.132 Received: from mfilter5-d.gandi.net (mfilter5-d.gandi.net [217.70.178.132]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id A3B8C17208B; Tue, 3 Apr 2012 19:39:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter5-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter5-d.gandi.net (mfilter5-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id oTo4BY9vWCm5; Tue, 3 Apr 2012 19:39:08 +0200 (CEST) X-Originating-IP: 98.27.54.176 Received: from [192.168.10.146] (cpe-098-027-054-176.nc.res.rr.com [98.27.54.176]) (Authenticated sender: adsend@dunslane.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id BF5E1172085; Tue, 3 Apr 2012 19:39:07 +0200 (CEST) Message-ID: <4F7B35B9.50108@dunslane.net> Date: Tue, 03 Apr 2012 13:39:05 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: Kevin Kempter CC: "pgsql-performance@postgresql.org" Subject: Re: Update join performance issues References: <4F7B3394.3030703@consistentstate.com> In-Reply-To: <4F7B3394.3030703@consistentstate.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201204/30 X-Sequence-Number: 46676 On 04/03/2012 01:29 PM, Kevin Kempter wrote: > Hi All; > > I have a query that wants to update a table based on a join like this: > > update test_one > set f_key = t.f_key > from > upd_temp1 t, > test_one t2 > where > t.id_number = t2.id_number Why is test_one in the from clause? update joins whatever is in the from clause to the table being updated. You almost never need it repeated in the from clause. cheers andrew