Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does the order of columns matter?
Message
From
01/09/2016 10:21:30
Thomas Ganss (Online)
Main Trend
Frankfurt, Germany
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01639951
Message ID:
01640327
Views:
37
>>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
Map
View

Click here to load this message in the networking platform