Home Forums SQL Server 2005 Administering Indexing Question RE: Indexing Question<!-- 864 -->

  • GBeezy (8/20/2014)


    Thanks Jack for the response.

    I have another question, I just started at this job and I am seeing tables that do not have a PK or a Clustered Index on them. I have a feeling that I should be finding a good column to create a clustered index on and get it done. I am wondering what if any negative side effects this could have??? Can you shed some light on this for me?

    First, don't confuse Primary Keys and Clustered Indexes as they are different things and serve different purposes. A Primary Key is something that defines a unique entity, by default, SQL Server does create a clustered index when creating a Primary Key, but you don't have to do that. A Clustered Index defines the logical order the data in the table is stored in. A primary key can be a business key or a surrogate key (should always be backed up with a business key) and if it is a business key it often is not the best candidate for clustering.

    SQL Server does tend to work better with tables that have a clustered index than with heaps, with the caveat that you have chosen the right column(s) for the clustering key. I'd start by reading all the posts by Kimberly Tripp on clustered indexes. This one[/url] has links to all of them. She explains things much better than I could.