If I have a composite key (primary or plain index) based on fields, say Year(int) and Ord(int), will filtering WHERE Year=2011 benefit from that key or will it ignore it completely?
If I have a composite key (primary or plain index) based on fields, say
Share
If you filter on the n left-most columns (where n >= 1), then that index could at least be used (might still be ignored due to other facts).
So if your index is on
(Year, Ord)and you filter byYear– then yes, that index might be used.However, if you filter on
Ordalone, that filter will not even be considered – it cannot be used.