Skip to main content
2 of 2
typo
Michael Green
  • 25.1k
  • 13
  • 53
  • 98

Probably Timestamp is very selective, possible even unique. As such there is no point in adding other fields to the key, they will only increase the size of the key without contributing to the selectivity. Having them as INCLUDED columns instead allows them to be added only to the leaf pages, saving on the overall size of the index.

select top(1000) count(*) as cnt, Timestamp 
from ...
group by Timestamp
order by cnt desc;

What does the above return?

Remus Rusanu
  • 52k
  • 4
  • 95
  • 172