GUID与INT IDENTITY [英] GUID vs INT IDENTITY
问题描述
Possible Duplicate:
How do you like your primary keys?
我知道使用GUID的好处,以及在数据库中使用和INT作为PK的好处。考虑到GUID本质上是128位INT,正常INT是32位,INT是一个空间节省器(虽然这一点在大多数现代系统中通常是无效的)。
I'm aware of the benefits of using a GUID, as well as the benefits of using and INT as a PK in a database. Considering that a GUID is in essence a 128 bit INT and a normal INT is 32 bit, the INT is a space saver (though this point is generally moot in most modern systems).
最后,在什么情况下,您会看到自己使用INT作为PK和GUID?
In the end, in what circumstances would you see yourself using an INT as a PK versus a GUID?
推荐答案
Kimberley Tripp(SQLSkills.com)有一篇关于使用GUID作为主键的文章。她建议反对,因为不必要的开销。
Kimberley Tripp (SQLSkills.com) has an article on using GUID's as primary keys. She advices against it because of the unnecessary overhead.
这篇关于GUID与INT IDENTITY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!