X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A3159D1EB59 for ; Fri, 2 Apr 2004 15:52:39 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 67475-06 for ; Fri, 2 Apr 2004 11:52:42 -0400 (AST) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 33C36D1EB5F for ; Fri, 2 Apr 2004 11:52:37 -0400 (AST) Received: (qmail 5373 invoked by uid 500); 2 Apr 2004 15:56:04 -0000 Date: Fri, 2 Apr 2004 09:56:04 -0600 From: Bruno Wolff III To: Palle Girgensohn Cc: pgsql-performance@postgresql.org Subject: Re: single index on more than two coulumns a bad thing? Message-ID: <20040402155604.GC5151@wolff.to> Mail-Followup-To: Palle Girgensohn , pgsql-performance@postgresql.org References: <24070000.1080860445@palle.girgensohn.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24070000.1080860445@palle.girgensohn.se> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/12 X-Sequence-Number: 6312 On Fri, Apr 02, 2004 at 01:00:45 +0200, Palle Girgensohn 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.