X-Original-To: pgsql-sql@postgresql.org Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 7231C4762F8 for ; Wed, 5 Mar 2003 09:53:15 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 4355F43A896; Wed, 5 Mar 2003 09:53:14 -0500 (EST) Message-ID: <3E660E0C.2020605@kyborg.dk> Date: Wed, 05 Mar 2003 15:47:40 +0100 From: Kim Petersen Organization: Kyborg A/S User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: da, en-us MIME-Version: 1.0 X-Newsgroups: comp.databases.postgresql.sql Subject: Re: problematic query (for me ;-) [solved? - sorry to bother] References: <3E660A41.7040509@kyborg.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 16 X-Complaints-To: abuse@post.tele.dk To: pgsql-sql@postgresql.org X-Archive-Number: 200303/300 X-Sequence-Number: 12339 Kim Petersen wrote: > I'm trying to get a hint as to how i can solve this problem: it seems it works to post to a newsgroup - i've been trying to solve this for hours - and just came up with a solution - only question now is whether or not it is usable (on millons of tuples). select distinct t1.n,t2.n from test t1,test t2 where not exists (select t from test where n=t1.n intersect select t from test where n=t2.n); optimization ideas would be greatly appreciated.