X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 670CF3C986A for ; Thu, 16 Dec 2004 14:16:10 +0000 (GMT) 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 85529-01 for ; Thu, 16 Dec 2004 14:16:02 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by svr1.postgresql.org (Postfix) with ESMTP id 55AFC3C9763 for ; Thu, 16 Dec 2004 14:16:04 +0000 (GMT) Received: from [212.227.126.207] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CewQG-0003QN-00; Thu, 16 Dec 2004 15:16:04 +0100 Received: from [194.25.154.138] (helo=pinguin.schollglas.com) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1CewQG-0003Qt-00; Thu, 16 Dec 2004 15:16:04 +0100 Received: from kretschmer by pinguin.schollglas.com with local (Exim 3.33 #6) id 1CewQ9-0004SP-00; Thu, 16 Dec 2004 15:15:57 +0100 Date: Thu, 16 Dec 2004 15:15:57 +0100 From: Andreas Kretschmer To: pgsql-sql@postgresql.org Cc: Andreas Kretschmer Subject: Re: [despammed] question about index Message-ID: <20041216141557.GA17096@Pinguin.wug-glas.de> References: <20041216104154.GA30578@mail.librelogiciel.com> <20041216110139.GA5899@Pinguin.wug-glas.de> <20041216141025.GC2768@wolff.to> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041216141025.GC2768@wolff.to> User-Agent: Mutt/1.4i X-DEST: 208 X-MSMail-Priority: High X-MSMail-Virus: X5O!P%@AP[4PZX54(P^)7CC)7}-STANDARD-ANTIVIRUS-TEST-FILE!+H* X-Message-Flag: My name is root. Just root. And I am licensed to kill -9 X-PrivatMail: kretschmer@kaufbach.delug.de X-OS: Linux - weil ich es mir Wert bin! X-Info: registrierter Linux-User 97922 http://counter.li.org X-LUG: http://lug-dd.schlittermann.de X-Handy: 0160 / 8256486 (privat) X-Fax: 035204 / 40505 (privat) X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:51ea9561fc3f6d9539a2acd743e4748c X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.658 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_WHOIS, MISSING_MIMEOLE, X_MSMAIL_PRIORITY_HIGH X-Spam-Level: X-Archive-Number: 200412/107 X-Sequence-Number: 19727 am 16.12.2004, um 8:10:25 -0600 mailte Bruno Wolff III folgendes: > On Thu, Dec 16, 2004 at 12:01:39 +0100, > Andreas Kretschmer wrote: > > > > > > considering that almost 70% of the rows will be with 'VALUE1', 20% > > > will be with 'VALUE2' and 10% will be with 'VALUE3' on the average. > > > > > > should I create an index to speedup the counts or not ? > > > > Yes. > > Indexes will probably not help in this case. Even when looking at 10% of > the rows, a sequential scan is still going to be faster than an index > scan in most cases. Okay. Andreas -- Andreas Kretschmer (Kontakt: siehe Header) Tel. NL Heynitz: 035242/47212 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net === Schollglas Unternehmensgruppe ===