Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 06F43476AA7 for ; Mon, 15 Apr 2002 10:50:00 -0400 (EDT) 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 g3FEnWF22993; Mon, 15 Apr 2002 10:49:32 -0400 (EDT) To: Michael Contzen Cc: pgsql-sql@postgresql.org Subject: Re: How slow is DISTINCT? In-reply-to: <3CB2BF53.77D41E79@dohle.com> References: <3CB2BF53.77D41E79@dohle.com> Comments: In-reply-to Michael Contzen message dated "Tue, 09 Apr 2002 12:15:47 +0200" Date: Mon, 15 Apr 2002 10:49:32 -0400 Message-ID: <22990.1018882172@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200204/186 X-Sequence-Number: 7450 Michael Contzen writes: > Does postgres sort the whole table without projection to one column an > performs a unique on this whole table? No, it only sorts the column(s) being selected. My guess is that your performance problem comes from using "numeric" datatype. Consider int or bigint instead of numeric(10,0). regards, tom lane