Should you index a Primary Key?

  • I just want to bounce this off of someone.

    If I make a primary key on a table, I don't have to make a corresponding index for it also, right? Seems redundant, since a primary keys is also and index, right.

    Mike

  • Correct, the primary key is an index.

    Regards,

    Andy Jones

    .

  • Correct, adding a Primary Key to a table also adds and Index to that table.

    However, when you add a Foreign Key constraint it will not automatically add an index for you, although an index on Foreign Key fields will aid performance.

    You also have the option when you create your Primary Key of deciding whether to make it clustered or non-clustered. It will default to clustered and many people leave it as the clustered index, but you may find that system performance can be improved by placing your clustered index on a field other than your primary key.

  • Thanks, guys.

    You're way cool.

    Case closed.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply