X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 77A98D1B199 for ; Tue, 3 Aug 2004 22:31:12 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59932-01 for ; Wed, 4 Aug 2004 01:31:12 +0000 (GMT) Received: from houston.familyhealth.com.au (fhnet.arach.net.au [203.22.197.21]) by svr1.postgresql.org (Postfix) with ESMTP id 5D10AD1B1B4 for ; Tue, 3 Aug 2004 22:31:05 -0300 (ADT) Received: from [192.168.0.40] (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9p1/8.12.9) with ESMTP id i741V4Ui090216; Wed, 4 Aug 2004 09:31:06 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <41103CC5.7030207@familyhealth.com.au> Date: Wed, 04 Aug 2004 09:32:53 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Merlin Moncure Cc: Marius Andreiana , pgsql-performance@postgresql.org Subject: Re: NOT IN query takes forever References: <6EE64EF3AB31D5448D0007DD34EEB34101AF1A@Herge.rcsinc.local> In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB34101AF1A@Herge.rcsinc.local> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/41 X-Sequence-Number: 7677 > explain analyze actually runs the query to do timings. Just run explain > and see what you come up with. More than likely there is a nestloop in > there which is causing the long query time. > > Try bumping up shared buffers some and sort mem as much as you safely > can. Just use an EXISTS query I suggest. Chris