pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Markus Schaber <schabi@logix-tt.com>
Cc: Oscar Picasso <oscgoogle@yahoo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Better index stategy for many fields with few values
Date: Wed, 12 Apr 2006 15:44:22 -0500
Message-ID: <20060412204421.GK49405@pervasive.com> (raw)
In-Reply-To: <443CF9B4.2080009@logix-tt.com>
References: <20060410165857.91471.qmail@web54705.mail.yahoo.com>
	<443CF9B4.2080009@logix-tt.com>

On Wed, Apr 12, 2006 at 02:59:32PM +0200, Markus Schaber wrote:
> > I was thinking about using a multicolumns index, but I have read that
> > we should limit multicolumns indice to at most 2 or 3 columns.
> 
> Yes, that's true, the index overhead gets too high.
> 
> > 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?
 
> I just had another weird idea:
> 
> As your paramXX values can have only 10 parameters, it also might be
> feasible to use a bunch of 10 conditional indices, like:
> 
> CREATE INDEX foo1 ON table (param1, param2 WHERE param0='1st value';
> CREATE INDEX foo2 ON table (param1, param2 WHERE param0='2nd value';
> CREATE INDEX foo3 ON table (param1, param2 WHERE param0='3rd value';
> [...]

Not all that weird; it's known as index partitioning.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (10+ messages)  latest in thread

Message-ID: <20060412204421.GK49405@pervasive.com>
Permalink:  ../20060412204421.GK49405@pervasive.com/
Also on:    postgresql.org/message-id/20060412204421.GK49405@pervasive.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jnasby@pervasive.com, schabi@logix-tt.com, oscgoogle@yahoo.com
  Subject: Re: Better index stategy for many fields with few values
  In-Reply-To: <20060412204421.GK49405@pervasive.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox