Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A5B3B9F997F for ; Mon, 29 Oct 2007 15:43:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 00390-03 for ; Mon, 29 Oct 2007 15:43:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 75E149F997E for ; Mon, 29 Oct 2007 15:43:00 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l9TIgv5P014486; Mon, 29 Oct 2007 14:42:57 -0400 (EDT) To: dev@kbsolutions.ch cc: pgsql-sql@postgresql.org Subject: Re: update from select In-reply-to: <0f0501c81a40$538ce1b0$1601a8c0@kbsc1> References: <0d5e01c81a0c$b0f67250$1601a8c0@kbsc1> <20071029104529.GB16653@a-kretschmer.de> <0f0501c81a40$538ce1b0$1601a8c0@kbsc1> Comments: In-reply-to message dated "Mon, 29 Oct 2007 16:28:15 +0100" Date: Mon, 29 Oct 2007 14:42:57 -0400 Message-ID: <14485.1193683377@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/148 X-Sequence-Number: 29520 writes: > Hash Join (cost=10827.45..25950.05 rows=4906 width=1191) (actual > time=586.251..2852.691 rows=111306 loops=1) > ... > Total runtime: 633548.404 ms So you're worried about the wrong thing entirely. The query is taking less than 3 seconds, which may be reasonable considering it's producing 111000 join rows. The big problem is the other 630 seconds, which is evidently update overhead. I'm wondering if you have any triggers or foreign keys leading to or from this table. regards, tom lane