X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 933FAD1B540 for ; Mon, 13 Oct 2003 01:39:06 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 79802-06 for ; Sun, 12 Oct 2003 22:38:36 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 53FADD1B543 for ; Sun, 12 Oct 2003 22:38:16 -0300 (ADT) Received: from [192.168.5.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.5) with ESMTP-TLS id 423219; Sun, 12 Oct 2003 18:37:47 -0700 Message-ID: <3F8A01CE.2040003@joeconway.com> Date: Sun, 12 Oct 2003 18:37:18 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Griffiths Cc: pgsql-performance@postgresql.org Subject: Re: Another weird one with an UPDATE References: <052001c39030$1ccc8020$6501a8c0@griffiths2> <05a401c3903f$a8524850$6501a8c0@griffiths2> <20031011153251.F57866@megazone.bigpanda.com> <080d01c3912a$1356dea0$6501a8c0@griffiths2> In-Reply-To: <080d01c3912a$1356dea0$6501a8c0@griffiths2> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/406 X-Sequence-Number: 4154 David Griffiths wrote: >>I think you want something like: >>UPDATE user_account SET last_name = 'abc' >> WHERE EXISTS (SELECT 1 FROM commercial_entity ce, commercial_service cs >> WHERE user_account.user_account_id = ce.user_account_id AND >> ce.commercial_entity_id = cs.commercial_entity_id); > > Unfort, this is still taking a long time. > ------- > Seq Scan on user_account (cost=0.00..748990.51 rows=36242 width=716) Do you have an index on user_account.user_account_id? Joe