Re: Multicolum index and primary key

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Michele Bendazzoli <mickymouse(at)mickymouse(dot)it>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Multicolum index and primary key
Date: 2003-11-17 16:14:33
Message-ID: Pine.LNX.4.44.0311171713460.12502-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2003-11-17 16:15:15 Re: Multicolum index and primary key
Previous Message Tomasz Myrta 2003-11-17 15:35:07 Re: strange "not deferrable" behaviour