Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does the order of columns matter?
Message
From
02/09/2016 03:50:10
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01639951
Message ID:
01640390
Views:
42
>>>>>>>If I read that right then my supposition was correct ? :
>>>>>>>"Additional columns should be ordered based on their level of distinctness, that is, from the most distinct to the least distinct."
>>>>>>
>>>>>>In other words, from the most selective (e.g. column with many unique values) to the less selective (column with less values). This is how I understand it and this is what I said.
>>>>>
>>>>>You said: "If you have many categories and just few sites, then using Category as first column "
>>>>
>>>>Right, this is how I understand the above sentence. Are you saying that my understanding is wrong?
>>>
>>>Seems so to me. In your example categories is the 'least distinct' but you advocate putting it before sites.....
>>
>>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.

Not in the example used - last name was limited to 'Smith' and 'Jones'

>The original document, I think, proposed LastName, FirstName index.
Previous
Reply
Map
View

Click here to load this message in the networking platform