Re: Primary keys and indexes

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Keith Worthington <keithw(at)narrowpathinc(dot)com>
Cc: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Primary keys and indexes
Date: 2005-01-21 21:20:09
Message-ID: 20050121212009.GA1022@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, Jan 21, 2005 at 15:54:36 -0500,
Keith Worthington <keithw(at)narrowpathinc(dot)com> wrote:
> Hi All,
>
> Does building a primary key constraint automatically generate an index? Using
> pgadmin I cannot see it if it does. Should I explicitly build indexes on
> primary keys? Wouldn't building a unique index on the same columns as the
> primary key be redundent? Your guidance is appreciated.

Yes, when you declare a primary (or unique) key a unique index over the
columns of the key is created.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message operationsengineer1 2005-01-21 21:40:33 SQL and DB Connection Question (Interfacing with PHP)
Previous Message Keith Worthington 2005-01-21 20:54:36 Primary keys and indexes