| From: | Ow Mun Heng <Ow(dot)Mun(dot)Heng(at)wdc(dot)com> |
|---|---|
| To: | "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Indexes & Primary Keys (based on the same columns) |
| Date: | 2007-10-22 03:53:47 |
| Message-ID: | 1193025227.1104.28.camel@neuromancer.home.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Sun, 2007-10-21 at 20:49 -0700, Joshua D. Drake wrote:
> Ow Mun Heng wrote:
> > I'm wondering if what I'm doing is redundant.
> >
> > I have a primary key on columns (A,B,C,D)
> > and I've also defined an index based on the same columns (A,B,C,D)
> >
> > and sometimes in the query explain, I see the pkey being used for the
> > scan instead of the index.
> >
> > So.. That made me think perhaps the additional index on the _same_
> > parameter is redundant.
>
> A primary key creates an index so having a second index with the same
> definition is redundant.
Many thanks for the confirmation.
I'm dropping them...
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2007-10-22 03:55:16 | Re: Indexes & Primary Keys (based on the same columns) |
| Previous Message | Joshua D. Drake | 2007-10-22 03:53:13 | Re: looking for some real world performance numbers |