具有索引的uniqueidentifier [英] uniqueidentifier with index

查看:194
本文介绍了具有索引的uniqueidentifier的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果uniqueidentifier数据类型列为集群/表中的非集群索引sql server 2005/2008将会产生什么影响。我读了它是非常设计的表,如何避免这个问题和什么是最好的解决方案?

what will be the effect if uniqueidentifier data type column is clustered/Non Clustered index in a table sql server 2005/2008. I read it is badly designed table, how to avoidy this problem and what is the best solution?

推荐答案

聚集,它只是意味着索引将是宽的(每行16字节,而不是每行4个字节,整数)。

If it is non-clustered, it just means the index will be wide (16 bytes per row, rather than 4 bytes per row with an integer).

如果它是聚类的,则插入将导致页面分割,取决于您在创建/重建索引时离开的可用空间(填充因子)多少。

If it is clustered, then insertions will lead to page splits, depending on how much free space (Fill Factor) you leave in the index when you create/rebuild it.

有关SO讨论的几个问题这个话题:

There are a few questions on SO discussing this topic:

我应该去除Guid列上的聚集索引

GUID / UUID数据库密钥的优点和缺点

SQL Server中唯一标识符ID列上的聚集主键

提高集群索引GUID主键的性能

这篇关于具有索引的uniqueidentifier的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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