Is it a bad idea to use GUIDs as primary keys in MS SQL?

前端 未结 2 1616
时光说笑
时光说笑 2020-12-23 07:52

We have a system that uses UniqueIdentifier as the primary key of each of the tables. It has been brought to our attention that this is a bad idea. I have seen similar post

2条回答
  •  失恋的感觉
    2020-12-23 08:30

    I wrote a post about this last week with some code to show you what happens: Some Simple Code To Show The Difference Between Newid And Newsequentialid

    Basically if you use newid() instead of Newsequentialid() you get horrible page splits if your PK is a clustered index (which it will be by default)

提交回复
热议问题