Clustered indexes question

  • stewartc (9/9/2009)


    My recommendation then:

    clustered index on ClientID, non clustered index in the GUID.

    ClientID is a GUID.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Yep. That's right. Booth clientId and Id are Guids.

    And since they are the primary key might as well be clustered...

    Pedro



    If you need to work better, try working less...

  • This was removed by the editor as SPAM

  • See my response http://www.sqlservercentral.com/Forums/FindPost754136.aspx

    to thread http://www.sqlservercentral.com/Forums/Topic751882-361-1.aspx

    Note that we are using GUIDs exclusively for most of our PKs. Very similar to your application. It gives us a lot of flexibility. As for fragmentation, you can't eliminate it. Note that a compound PK of two integer columns will also be fragmented as new entries are inserted.

    Additional note: Microsoft also uses GUIDs as PKs. Just look at the ReportServer database or any of their ASPNET applications.


    [font="Arial Narrow"](PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.[/font]

Viewing 4 posts - 16 through 18 (of 18 total)

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