GUID vs INT IDENTITY [duplicate]

2020-01-25 05:28发布

Possible Duplicate:
How do you like your primary keys?

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).

In the end, in what circumstances would you see yourself using an INT as a PK versus a GUID?

13条回答
Luminary・发光体
2楼-- · 2020-01-25 06:24

I think the database also matters. From a MySQL perspective - generally, the smaller the datatype the faster the performance.

It seems to hold true for int vs GUID too - http://kccoder.com/mysql/uuid-vs-int-insert-performance/

查看更多
登录 后发表回答