X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D001BD1DADA for ; Mon, 17 Nov 2003 16:27:07 +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 04418-04 for ; Mon, 17 Nov 2003 12:26:36 -0400 (AST) Received: from woodfire (ip-a1-37118.keycomm.it [62.152.37.118]) by svr1.postgresql.org (Postfix) with ESMTP id DA876D1B537 for ; Mon, 17 Nov 2003 12:26:35 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by woodfire (Postfix) with ESMTP id 68170D54 for ; Mon, 17 Nov 2003 18:29:05 +0100 (CET) Received: from woodfire ([127.0.0.1]) by localhost (woodfire [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03808-04 for ; Mon, 17 Nov 2003 18:29:05 +0100 (CET) Received: from osts (unknown [192.168.100.27]) by woodfire (Postfix) with ESMTP id 2FB93318 for ; Mon, 17 Nov 2003 18:29:05 +0100 (CET) Subject: Re: Multicolum index and primary key From: Michele Bendazzoli To: pgsql-sql In-Reply-To: References: Content-Type: text/plain Organization: Micky Mouse Message-Id: <1069090436.8338.25.camel@mickymouse.sintel> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Mon, 17 Nov 2003 18:33:56 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at sintelnet.it X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/202 X-Sequence-Number: 16017 On Mon, 2003-11-17 at 17:14, Peter Eisentraut wrote: > Michele Bendazzoli writes: > > > ALTER TABLE public.table1 > > ADD CONSTRAINT table1_pkey PRIMARY KEY(a, b, c); > > > > are the indexes over (a) and (a, b) redundant (and so useless)? > > Exactly. > > p.s. I know, I'll have to begin to use the explain command ... > > I promise I'll do it ;-) > > You could also have read the documentation about multicolumn indexes, > because it contains exactly this example. Thank you. I have read the chapter but I wonder if the implicit index created by the primary key behaves as a normal indexes at all. ciao, Michele