General information
Forum:
Microsoft SQL Server
>>If you allow me to nitpick: it is less the count of distinct values, but more the number of values excluded averaged across all values, which could be visualized as a kinda reverse distribution function. 100 possible values, 99 filled, but having a count of less than 3 and 199K on the last value is less selective as 15 distinct values with each grouped to a count between 10k and 20k ;-))
>
>So, to be completely clear on the topic of indexes - say, for the First and Last names, should the index be
>FirstName, LastName then?
>FirstName has less choices than LastName.
>
>The original document, I think, proposed LastName, FirstName index.
I was writing about the order (=benefit) of selectivity as encountered in ***any*** index with not only finite, but low count of entries. A compound index should be ONLY used if there is a need for part of index as well, and in most cases that would be Lastname as searches are done more ofeten for that field. There should be a speed benefit if "index difference" is realized "early in the string", but if that makes large speed differences in lookup I would guesstimate at a VERY naive implementation ;-)
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only