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 BC605329EE3 for ; Wed, 6 Oct 2004 20:40:50 +0100 (BST) 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 26505-05 for ; Wed, 6 Oct 2004 19:40:45 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 265B132A4E0 for ; Wed, 6 Oct 2004 20:40:45 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id i96JcQme029195; Wed, 6 Oct 2004 15:38:26 -0400 (EDT) To: Greg Stark Cc: =?iso-8859-1?q?Pierre-Fr=E9d=E9ric_Caillaud?= , "Ole Langbehn" , pgsql-performance@postgresql.org Subject: Re: sequential scan on select distinct In-reply-to: <874ql7ztnb.fsf@stark.xeocode.com> References: <200410061130.58625.ole@freiheit.com> <874ql7ztnb.fsf@stark.xeocode.com> Comments: In-reply-to Greg Stark message dated "06 Oct 2004 12:41:12 -0400" Date: Wed, 06 Oct 2004 15:38:26 -0400 Message-ID: <29194.1097091506@sss.pgh.pa.us> From: Tom Lane 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: 200410/67 X-Sequence-Number: 8543 Greg Stark writes: > why isn't a "skip index scan" plan available? Well, nobody's written the code > yet. I don't really think it would be a useful plan anyway. What *would* be useful is to support HashAggregate as an implementation alternative for DISTINCT --- currently I believe we only consider that for GROUP BY. The DISTINCT planning code is fairly old and crufty and hasn't been redesigned lately. regards, tom lane