When a unique clustered index is created on a view, the result set is stored in the database just like a table with a clustered index is stored.The first index created on a view must be a unique clustered index. After the unique clustered index has been created, you can create more nonclustered indexes.
a unique clustered index其实就是一种主键。也就是说,一旦在一个视图上建立主键,该视图就被物化到磁盘上。
As modifications are made to the data in the base tables, the data modifications are reflected in the data stored in the indexed view. The requirement that the clustered index of the view be unique improves the efficiency with which SQL Server can find the rows in the index that are affected by any data modification.
从SQL Server2000开始就有这个功能了。
http://msdn.microsoft.com/en-us/library/ms187864%28v=sql.105%29.aspx
本文详细介绍了在 SQL Server 中为视图创建唯一聚簇索引的过程,解释了其如何物化视图到磁盘,并在基表数据修改时实时更新索引数据,以提高数据修改时的查找效率。
872

被折叠的 条评论
为什么被折叠?



