• Paul White (3/1/2010)


    adish (3/1/2010)


    I've been using GUID as PKs, but this is a novel way of using it. Great.

    Not a clustered Primary Key, I trust?

    obviously the super-best data type for a PK is one that increments by 1 each time so the index is appended on each insert and there is no fragmentation,

    Any other data type is just as likely to fragment as a guid. I left-handedly proved this in one of my shamefully RBAR riddled articles: http://www.sqlservercentral.com/articles/Indexing/64424/

    It's the random insertion, not the datatype that causes the problem.

    What's the differece if the data inserted is Johnson, Jonsonn, Johnsen or three guids?

    Under the hood, there's not a difference.

    The only way you're not going to frag your index at an equal rate as a guid is if the data is inserted in the same order as the clustered index key. In OLTP, that's pretty unlikely except with and identity (which has it's own set of issues).

    ~Craig O.