问题描述
我们从我们以前的订货系统迁移大量数据。该系统存储在用户的缩写在我们的订单表中,他们创建的每个订单。现在,我们有一种观点认为,着眼于活动目录我想更新那些最初使用Active Directory的objectGUID(或者一些引用GUID)。这将允许我们改变在Active Directory中的用户姓名缩写,而不必担心更新订单表中的记录。
We migrated a lot of data from our old ordering system. This system stored the users initials in our "Orders" table for each order they created. Now that we have a view that looks at active directory I would like to update those initials with the active directory objectguid (or something that references the guid). This would allow us to change the users initials in active directory without having to worry about updating the "Orders" table records.
我读过使用VS整数的GUID时指数的表现不尽如人意。到可能解决这个问题的方法之一是有一个GUID的映射到整数,然后存放在我们的订单表中的int值的表。这会是一个好主意?有什么想法?
I've read that index performance is lackluster when using guids vs ints. One way to possibly solve this is have a table that maps guids to ints then store the int value in our orders table. Would this be a good idea? Any thoughts?
推荐答案
我假定的用户的实体已经存在于你的数据库的设计但是,如果没有的话,我相信你的解决方案将需要它
I assume that a USER entity already exists in your database design however, if it does not then I believe your solution will require it.
所以假设的用户的实体存在,如你所述,你可以放置在订单的用户名(INT)的表,从而与所有相关的用户的细节到的订单的,而不仅仅是缩写(注:首字母应该说是不被存储在订单的表,而是在用户或* USER_DETAILS *表,虽然这次讨论的不是重点)。
So assuming the USER entity exists, as you have described, you could place the UserID(int) on the ORDERS table, thereby relating all relevant USER details to an ORDER, rather than just initials (Note: Initials should arguably not be stored on the ORDER table but rather the USER or *USER_DETAILS* table, albeit not the focus of this discussion).
您可以再GUID列添加到用户表。我不认为一个单独的查找表是必要的。
You can then add the GUID column to the USER table. I don’t think a separate lookup table is necessary.
有意义吗?
这篇关于SQL Server的GUID(从Active Directory)与诠释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!