X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 208A29FA5DD for ; Thu, 1 Jun 2006 12:40:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 25557-10 for ; Thu, 1 Jun 2006 12:39:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from titan.startnet.cz (unknown [82.113.63.73]) by postgresql.org (Postfix) with ESMTP id 8CFF09FA040 for ; Thu, 1 Jun 2006 12:39:55 -0300 (ADT) Received: (qmail 3176 invoked from network); 1 Jun 2006 17:39:54 +0200 Received: from unknown (HELO ?192.168.1.2?) (miroslav.sulc@startnet.cz@10.15.192.25) by titan.local.startnet.cz with ESMTPA; 1 Jun 2006 17:39:54 +0200 Message-ID: <447F0A44.3080500@startnet.cz> Date: Thu, 01 Jun 2006 17:39:48 +0200 From: =?windows-1250?Q?Miroslav_=8Aulc?= Organization: StartNet s.r.o. User-Agent: Thunderbird 1.5.0.2 (X11/20060501) MIME-Version: 1.0 CC: pgsql-sql@postgresql.org Subject: Re: SELECT DISTINCT too slow References: <447EEAF1.7040305@startnet.cz> <12554.1149175230@sss.pgh.pa.us> In-Reply-To: <12554.1149175230@sss.pgh.pa.us> Content-Type: multipart/mixed; boundary="------------020906060706000002090606" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/9 X-Sequence-Number: 25245 This is a multi-part message in MIME format. --------------020906060706000002090606 Content-Type: text/plain; charset=windows-1250 Content-Transfer-Encoding: 8bit The GROUP BY is really fast :-) Thank you. Miroslav Šulc Tom Lane napsal(a): > Try > SELECT Key FROM MRTPContactValue GROUP BY Key > > The "select distinct" code is a bit old and crufty, GROUP BY is usually > smarter. > > regards, tom lane > --------------020906060706000002090606 Content-Type: text/x-vcard; charset=utf-8; name="miroslav.sulc.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="miroslav.sulc.vcf" begin:vcard fn;quoted-printable:Miroslav =C5=A0ulc n;quoted-printable:=C5=A0ulc;Miroslav org:StartNet s.r.o. adr;quoted-printable;quoted-printable:;;Schodov=C3=A1 309/10;Praha 5;;150 00;=C4=8Cesk=C3=A1 republika email;internet:miroslav.sulc@startnet.cz tel;cell:+420 603 711 413 x-mozilla-html:TRUE url:http://www.startnet.cz version:2.1 end:vcard --------------020906060706000002090606--