解决方法
The ratio of unique values within a key column is referred to as index
selectivity. The more unique the values,the higher the selectivity,
which means that a unique index has the highest possible selectivity.
The query engine loves highly selective key columns,especially if
those columns are referenced in the WHERE clause of your frequently
run queries. The higher the selectivity,the faster the query engine
can reduce the size of the result set. The flipside,of course,is
that a column with relatively few unique values is seldom a good
candidate to be indexed.
另请查看这些文章:
>由Pinal Dave检查this post
> this other在sql Serverpedia上
> This forum post在sqlServerCentral上也可以帮到你.
> This article也在sqlServerCentral上
In general,a nonclustered index should be selective. That is,the
values in the column should be fairly unique and queries that filter
on it should return small portions of the table.The reason for this is that key/RID lookups are expensive operations
and if a nonclustered index is to be used to evaluate a query it needs
to be covering or sufficiently selective that the costs of the lookups
aren’t deemed to be too high.If sql considers the index (or the subset of the index keys that the
query would be seeking on) insufficiently selective then it is very
likely that the index will be ignored and the query executed as a
clustered index (table) scan.It is important to note that this does not just apply to the leading column. There are scenarios where a very unselective column can be used as the leading column,with the other columns in the index making it selective enough to be used.