Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0TGwLl50453 for ; Tue, 29 Jan 2002 11:58:22 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g0TGvsf14792; Tue, 29 Jan 2002 11:57:54 -0500 (EST) To: "Zhang, Anna" cc: pgsql-admin@postgresql.org Subject: Re: tuning SQL In-reply-to: <5511D658682A7740BA295CCF1E1233A635A83F@vsvapostal2.bkup3> References: <5511D658682A7740BA295CCF1E1233A635A83F@vsvapostal2.bkup3> Comments: In-reply-to "Zhang, Anna" message dated "Tue, 29 Jan 2002 10:57:01 -0500" Date: Tue, 29 Jan 2002 11:57:54 -0500 Message-ID: <14789.1012323474@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200201/244 X-Sequence-Number: 3125 "Zhang, Anna" writes: > select count(*) from contact a, contact_discard b where a.contacthandle <> > b.contacthandle; Did you really mean "<>" here? If so, the plan you showed us is not for this query. The above query is going to take approximately forever to execute :-( If you meant "=", then the hash join that the system is using seems like a perfectly fine plan to me. regards, tom lane