当我更改索引视图的架构时,为什么我的索引会被删除?
服务器:MS Sql Server 2008
当我创建索引视图..然后更改视图的架构时,索引全部被删除。
真是太烦人了!
有人可以解释这是为什么吗?起初我认为这可能是因为索引所需的字段不再位于架构中(我们只是更改了它,对吧?)...但是对于索引字段始终位于视图架构中的情况。 ..它应该把索引留在那里。
无论如何..咆哮咆哮...
只是希望有人对此有一些内部知识。
Server: MS Sql Server 2008
When i create an indexed view .. and i then alter the view's schema, the index's all get dropped.
It's sooo annoying!
Can someone explain why this is? At first I thought that it could be because the fields the index requires are not in the schema any more (we did just alter it, right?) .... but for all the times when the index fields are in the view schema ... it should just leave the index there.
anyways.. rant rant rant ...
just hoping someone might have some inside knowledge on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该行为是设计使然。来自在线书籍:
当您修改架构时,必须重建聚集索引。由于所有非聚集索引都依赖于聚集索引,因此必须重建它们。这可能就是所有索引都被删除的原因。
The behavior is by design. From Books Online:
When you modify the schema, the clustered index will have to be rebuilt. Since all non-clustered indexes rely on the clustered index, they have to be rebuilt. That's probably why all the indexes are dropped.