当我在SQL 2005中删除聚集主键时会发生什么 [英] What happens when I drop a clustered primary key in SQL 2005

查看:174
本文介绍了当我在SQL 2005中删除聚集主键时会发生什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PK约束 - 两列上的聚簇索引 - 我正在删除的过程中。该命令在一个小时后仍然运行。我会认为,因为我只是删除约束,操作将几乎是即时的。

I've a PK constraint - a clustered index on two columns - which I am in the process of dropping. The command is still running after an hour. I would have thought that as I am just removing a constraint the operation would be nearly instantaneous. Can someone explain to me what is actually happening under the hood when I drop the PK?

推荐答案

集群索引是

当你删除它时,你的数据会从集群存储重新排序到堆存储

When you drop it, your data are being reordered from clustered storage to heap storage

其他索引正在更新以指向 RID '而不是 PRIMARY KEY 值。

Other indexes are being updated to refer to RID's instead of PRIMARY KEY values.

这篇关于当我在SQL 2005中删除聚集主键时会发生什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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