X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2F3E911F65DD for ; Thu, 13 Apr 2006 06:33:42 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.112 X-Spam-Level: X-Spam-Status: No, score=0.112 required=5 tests=[AWL=0.112] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id ayY-sJO4g-GB for ; Thu, 13 Apr 2006 06:33:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (unknown [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 8545D11F65B3 for ; Thu, 13 Apr 2006 06:33:38 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (T88a7.t.pppool.de [89.55.136.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 61AE7656CB for ; Thu, 13 Apr 2006 11:34:32 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id CBBB0181C1DF1 for ; Thu, 13 Apr 2006 11:33:53 +0200 (CEST) Message-ID: <443E1B01.5060804@logix-tt.com> Date: Thu, 13 Apr 2006 11:33:53 +0200 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Better index stategy for many fields with few values References: <20060410165857.91471.qmail@web54705.mail.yahoo.com> <443CF9B4.2080009@logix-tt.com> <20060412204421.GK49405@pervasive.com> In-Reply-To: <20060412204421.GK49405@pervasive.com> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archive-Number: 200604/293 X-Sequence-Number: 18377 Hi, Jim, Jim C. Nasby wrote: >>>I was also thinking about about using a functional index. >>If there's a logical relation between those values that they can easily >>combined, that may be a good alternative. > How would that be any better than just doing a multi-column index? 10 different values per column, and 20 columns are 10^20 value combinations. Partitioning it for the first column gives 10^19 combinations which is smaller than 2^64, and thus fits into a long value. And I just guess that a 10-partition functional index on a long value could perform better than a multi-column index on 20 columns of character(10), if only because it is approx. 1/25th in size. HTH, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org