Hi,
Using this as an example:
SELECT c1, c4 FROM myTable WHERE c1 = 1 and c2 = 2 and c3 = 3 ORDER BY c1
I created a clustered index on c1, c2, and c3 initially
Then I dropped that index and created a clustered index on c1 ONLY (c1 being the most selective column, but not unique)
and the execution plans were identical for both indexes
So, it seems that putting a clustered index on c1 is sufficient, since the clustered index contains all the data for the row, yes? No need to create a clustered index on c1, c2 and c3 - even though they are using in the where clauses.
Just wondering if my thinking is correct here.
Thanks
Using this as an example:
SELECT c1, c4 FROM myTable WHERE c1 = 1 and c2 = 2 and c3 = 3 ORDER BY c1
I created a clustered index on c1, c2, and c3 initially
Then I dropped that index and created a clustered index on c1 ONLY (c1 being the most selective column, but not unique)
and the execution plans were identical for both indexes
So, it seems that putting a clustered index on c1 is sufficient, since the clustered index contains all the data for the row, yes? No need to create a clustered index on c1, c2 and c3 - even though they are using in the where clauses.
Just wondering if my thinking is correct here.
Thanks