X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E36CE11F65B8 for ; Wed, 5 Apr 2006 11:10:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98015-01 for ; Wed, 5 Apr 2006 11:10:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 4356811F621E for ; Wed, 5 Apr 2006 11:09:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k35E9t5N027544; Wed, 5 Apr 2006 10:09:55 -0400 (EDT) To: "Andrus" cc: pgsql-performance@postgresql.org Subject: Re: Query runs too long for indexed tables In-reply-to: References: <1144180128.32266.56.camel@state.g2switchworks.com> Comments: In-reply-to "Andrus" message dated "Wed, 05 Apr 2006 12:39:46 +0300" Date: Wed, 05 Apr 2006 10:09:55 -0400 Message-ID: <27543.1144246195@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.114 required=5 tests=[AWL=0.114, UPPERCASE_25_50=0] X-Spam-Score: 0.114 X-Spam-Level: X-Archive-Number: 200604/59 X-Sequence-Number: 18143 "Andrus" writes: > UPDATE firma1.rid SET toode=NULL > WHERE toode IS NOT NULL AND > toode NOT IN (SELECT TOODE FROM firma1.TOODE); > How to speed this up ? Increasing work_mem to the point where you get a hashed NOT-IN would help, probably. Have you tried using EXPLAIN to see what the plan is for the UPDATEs? regards, tom lane