Поскольку это индекс, вам нужно выбрать столбец (или набор столбцов), который гарантированно будет не нулевым и уникальным во всех случаях. Это самый большой и самый строгий критерий - все, что может быть быть NULL или дублировать нельзя с самого начала.
В зависимости от типа запросов, которые вы будете запускать в этом индексированном представлении, вы также можете увидеть, есть ли у вас какие-либо столбцы (например, DATE или что-то еще), с которыми вы будете запускать запросы диапазона. Это может стать интересным кандидатом для кластеризации.
Но главное: ваш ключ кластеризации должен быть уникальным и не нулевым ни при каких обстоятельствах. И в моем личном опыте, чтобы уменьшить размер индекса (и, следовательно, увеличить количество записей на странице), я постараюсь использовать как можно меньше ключа - один INT лучше или комбинация из двух INT - или, возможно, GUID - но не используйте поля VARCHAR (500) в ключе кластеризации!
UPDATE: для всех тех плакатов, которые продолжают говорить нам кластерные индексы не должны быть уникальными - проверить, что «Королева индексирование», Kimberly Tripp, должен сказать по этой теме:
Let's start with the key things that I look for in a clustering key:
* Unique
* Narrow
* Static
Why Unique?
A clustering key should be unique because a clustering key (when one exists) is used as the lookup key from all non-clustered indexes. Take for example an index in the back of a book - if you need to find the data that an index entry points to - that entry (the index entry) must be unique otherwise, which index entry would be the one you're looking for? So, when you create the clustered index - it must be unique. But, SQL Server doesn't require that your clustering key is created on a unique column. You can create it on any column(s) you'd like. Internally, if the clustering key is not unique then SQL Server will “uniquify” it by adding a 4-byte integer to the data. So if the clustered index is created on something which is not unique then not only is there additional overhead at index creation, there's wasted disk space, additional costs on INSERTs and UPDATEs, and in SQL Server 2000, there's an added cost on a clustereD index rebuild (which because of the poor choice for the clustering key is now more likely).
Источник: http://www.sqlskills.com/blogs/kimberly/post/Ever-increasing-clustering-key-the-Clustered-Index-Debateagain!.aspx
Возможный дубликат [SQL Server - когда использовать кластерный или некластерный указатель?] (Https: // stackoverflow.com/questions/18304376/sql-server-when-to-use-clustered-vs-non-clustered-index) –