且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

主键列的数字或字符

更新时间:2023-02-06 18:19:19

也不是这样的。
您的主键应该是代理。 Int或big int,Guid如果缩放将是一个问题。
然后你应该把国家,省,城市和人作为一个独特的复合键。 智能数字很少是一个好主意。

Neither as such. Your primary key should be a surrogate. Int or big int, Guid if scaling is going to be an issue. Then you should have country, province, city and person as a unique compound key. The 'intelligent' number thingy is rarely a good idea.