Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 28D3F476F26 for ; Fri, 4 Oct 2002 11:05:44 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 02085477105 for ; Fri, 4 Oct 2002 10:44:56 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g94EimhR020690; Fri, 4 Oct 2002 10:44:48 -0400 (EDT) To: "Michael Contzen" Cc: pgsql-sql@postgresql.org Subject: Re: How slow is distinct - 2nd In-reply-to: References: Comments: In-reply-to "Michael Contzen" message dated "Tue, 01 Oct 2002 14:18:50 +0200" Date: Fri, 04 Oct 2002 10:44:48 -0400 Message-ID: <20689.1033742688@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/64 X-Sequence-Number: 9782 "Michael Contzen" writes: > [ select distinct takes a long time on 7+ million rows ] What do you have sort_mem set to? The default value is mighty small, and that would translate directly to poor performance in DISTINCT. Still though, the speed differential against Oracle is surprising, given that they don't seem to be using a fundamentally different implementation. Time to get out the profiler ... regards, tom lane