Re: cluster index on primary key

From: Rodrigo De León <rdeleonp(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org, "Sabin Coanda" <sabin(dot)coanda(at)deuromedia(dot)ro>
Subject: Re: cluster index on primary key
Date: 2007-06-11 14:44:33
Message-ID: a55915760706110744t7eaeaad0w4556a56881109ae2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 6/11/07, Sabin Coanda <sabin(dot)coanda(at)deuromedia(dot)ro> wrote:
> I'd like to know when I create a primary key on a table, does postgres will
> create automatically an index on that table related to the primary key
> columns, or I have to create it explicitly ?

From http://www.postgresql.org/docs/8.2/static/indexes-unique.html :

"PostgreSQL automatically creates a unique index when a unique
constraint or a primary key is defined for a table. The index covers
the columns that make up the primary key or unique columns (a
multicolumn index, if appropriate), and is the mechanism that enforces
the constraint."

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message LITTLE Nelson 2007-06-13 02:03:12 Using INET types in prepared statements
Previous Message Sabin Coanda 2007-06-11 14:31:03 cluster index on primary key