Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should I index a non-clustered Primary Key?

Status
Not open for further replies.

Crowley16

Technical User
Jan 21, 2004
6,931
GB
basically, I have a table with a non-clustered varchar primary key.

I'm wondering if I need to add another explicit index onto the primary key index, or if the primary key itself is by default indexed.

thanks.

--------------------
Procrastinate Now!
 
I should add:

even though I have turned off the clustered option for the primary key index.

--------------------
Procrastinate Now!
 
For a moment I though you were joking

A non clustered index is indexed, a PK is either a clustered (default) or non clustered index

depending on how the data is searched for should determine what index type to use. You can only have 1 clustered index and 249 non clustered indexes per table, this is the reason you have to make sure that you know where you want to put the clustered index (on what columns I mean)

Denis The SQL Menace
--------------------
SQL Server Code,Tips and Tricks, Performance Tuning
SQLBlog.com, Google Interview Questions
 
cheers, I thought that was the case but just wanted someone else to confirm.

it's like the unique index, I was once unsure wether it only made sure the column was unique or it was a full index in it's own right...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top