I have a nonclustered index (called
col1, col2 of a table. I included
col3, col4, col5, col6 as included columns in this order.
If I run the following query:
select col1,col2 from tbl1 where col3 = something and col4 = something and col5 = something
Is it any different than running:
select col3,col2 ,col4 from tbl1 where col1 = something and col5 = something
What I am trying to say is, when we create a covering index like the above, and we change the order in which we are accessing data, will it still take advantage of this covering index?
Also, the order of equality columns (amongst themselves) and non equality columns (amongst themselves)... does it matter? Like
where equalitycol2='' and equalitycol1=''.