唯一身份验证GUI上的SQL Azure SPLIT [英] SQL Azure SPLIT ON UNIQUEIDENTIFIER GUID

查看:89
本文介绍了唯一身份验证GUI上的SQL Azure SPLIT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比方说,有一个应用程序生成与几个表中的规范化记录数量相对应的随机GUID.这些带有GUID"tenant_id"的记录需要在SQL Azure中拆分为多个联合成员.发出SPLIT AT命令时,使用哪种排序机制在特定点(tenant_id)拆分成员?它类似于ORDER BY GUID_FIELD ASC/DESC结果集吗?由于GUID是随机生成的,因此用将来的分割创建范围的最佳方法是什么?

Let's say there is an application generating random GUIDs corresponding to number of normalized records in a few tables. These records with GUID "tenant_id" need to be split into multiple federated members in SQL Azure. When the SPLIT AT command is issued, what ordering mechanism is used to split members at a specific point (tenant_id)? Is it similar to ORDER BY GUID_FIELD ASC/DESC resultset? Since GUIDs are generated randomly, what is the best way to create ranges with future splits?

谢谢

推荐答案

GUID范围是根据SQL Server中的排序顺序进行拆分的-与O​​RDER BY和索引相同.有关更多详细信息,请参阅此博客文章:

GUIDs ranges are split according to their sort order in SQL Server - the same that is used for ORDER BY and indexes. See this blog post for more details on this: http://sqlblog.com/blogs/alberto_ferrari/archive/2007/08/31/how-are-guids-sorted-by-sql-server.aspx

如果您随机生成GUID,并且需要拆分,则应使用GUID的排序定义在要拆分的成员中的GUID集的中间选择一个点(假设您想在拆分的成员中拆分).中间).

If you are generating GUIDs randomly and you need to split, you should use the ordering definition for GUIDs to pick a point somewhere in the middle of the set of GUIDs in the member you are splitting (assuming you want to split in the middle).

如果您想进一步控制租户的去向,可以生成自己的自定义" GUID,但是,除非您确保自定义"的全局唯一生成,否则,您当然会失去GUID的全局唯一性. "GUID.

If you want more control about what tenants go where, you could generate your own, "custom" GUIDs, but then you will of course lose the global uniqueness property that GUIDs have, unless you ensure globally unique generation of your "custom" GUIDs.

-汉斯·奥拉夫(Hans Olav)

-- Hans Olav

这篇关于唯一身份验证GUI上的SQL Azure SPLIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆