Skip site navigation (1) Skip section navigation (2)

Re: single index on more than two coulumns a bad thing?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Palle Girgensohn <girgen(at)pingpong(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: single index on more than two coulumns a bad thing?
Date: 2004-04-02 15:56:04
Message-ID: 20040402155604.GC5151@wolff.to (view raw or flat)
Thread:
Lists: pgsql-performance
On Fri, Apr 02, 2004 at 01:00:45 +0200,
  Palle Girgensohn <girgen(at)pingpong(dot)net> wrote:
> 
> Is it always bad to create index xx on yy (field1, field2, field3);
> 
> I guess the problem is that the index might often grow bigger than the 
> table, or at least big enough not to speed up the queries?

One place where you need them in postgres is enforcing unique multicolumn
keys. These will get created implicitly from the unique (or primary key)
constraint. It isn't all that unusual to have a table that describes
a many to many (to many ...) relationship where the primary key is all
of the columns.

In response to

Responses

pgsql-performance by date

Next:From: Clive PageDate: 2004-04-02 16:05:01
Subject: Re: Spatial join insists on sequential scan of larger
Previous:From: Tom LaneDate: 2004-04-02 15:46:26
Subject: Re: Spatial join insists on sequential scan of larger table

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group