Table has no natural primary key and no clustered index

  • Hi all

    I am wondering what is best practice when a table has no natural primary key and no clustered index, what is the best thing to do in regards to putting a clustered index on it.

    I have a query that runs against the table which the execution plan has recommended a non-clustered index, but should this not be a clustered index instead?

    Thanks

  • The answer is almost always "Depends"

    Here's a good read.

    http://www.sqlskills.com/blogs/kimberly/post/the-clustered-index-debate-continues.aspx

  • Kwisatz78 (12/20/2012)


    Hi all

    I am wondering what is best practice when a table has no natural primary key and no clustered index, what is the best thing to do in regards to putting a clustered index on it.

    I have a query that runs against the table which the execution plan has recommended a non-clustered index, but should this not be a clustered index instead?

    Thanks

    From details you gave, I can only give very generic idea: Add identity column and create unique clustered index on it.

    With more details provided you are likely to get more relevant advice.

    What kind of data your table is for? Transactional?

    Which column do you use in filters when you query this table (most commonly)?

    What kind of filter do you apply?

    Do you join this table to another one? Which column?

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

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