Search code examples
sql-server-2008-r2primary-keyclustered-indexnon-clustered-index

unclustered PrimaryKey and clustered index


In one of our tables there is an existing non-clustered Primary Key on a UNIQUEIDENTIFIERcolumn, heavily used in FKs.

We now want to add an IDENTITY column and create a unique clustered index for this.

I do not need an explanation of clustered vs. non-clustered or about "what is a primary key?".

I want to

  1. drop all indexes
  2. add the new column with IDENTITY
  3. create the unique clustered index on the new column
  4. re-create all indexes

My question are:

  1. Will the new clustered index be used as look up key?
  2. Will the Primary Key use the clustered key?
  3. What implications could be, using a clustered key and a non-clustered PK side by side?

Thank you!


Solution

    1. Will the new clustered index be used as look up key?

    Yes the clustered key will be the look up key.

    1. Will the Primary Key use the clustered key?

    Yes primary key always has a clustered index attached to it.

    1. What implications could be, using a clustered key and a non-clustered PK side by side?

    This depends on the usage of your table and the associated columns.