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 1C90E5E46C1 for ; Sun, 15 Aug 2004 16:40:42 -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 82300-02 for ; Sun, 15 Aug 2004 19:40:37 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3B1D55E46BF for ; Sun, 15 Aug 2004 16:40:36 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i7FJebo4029080; Sun, 15 Aug 2004 15:40:37 -0400 (EDT) To: Ole Tange Cc: pgsql-performance@postgresql.org Subject: Re: Help interpreting explain analyze output In-reply-to: References: <28313.1092593619@sss.pgh.pa.us> Comments: In-reply-to Ole Tange message dated "Sun, 15 Aug 2004 21:08:19 +0200" Date: Sun, 15 Aug 2004 15:40:37 -0400 Message-ID: <29079.1092598837@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: 200408/243 X-Sequence-Number: 7879 Ole Tange writes: > Now I am curious: Why isn't DISTINCT implemented using a Hash aggregate? Partly lack of round tuits, partly the fact that it is closely intertwined with ORDER BY and I'm not sure what side-effects would arise from separating them. In particular, the DISTINCT ON special case stops making any sense at all if it's not tied to a sort/uniq underlying implementation. regards, tom lane